@lobehub/charts 5.7.0 → 5.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AccuracyBarChart/index.d.mts +62 -0
- package/es/AccuracyBarChart/index.mjs +326 -0
- package/es/AccuracyBarChart/index.mjs.map +1 -0
- package/es/AccuracyBarChart/styles.d.mts +14 -0
- package/es/AccuracyBarChart/styles.mjs +71 -0
- package/es/AccuracyBarChart/styles.mjs.map +1 -0
- package/es/AreaChart/index.d.mts +13 -0
- package/es/AreaChart/index.mjs +308 -0
- package/es/AreaChart/index.mjs.map +1 -0
- package/es/AreaChart/styles.d.mts +9 -0
- package/es/AreaChart/styles.mjs +28 -0
- package/es/AreaChart/styles.mjs.map +1 -0
- package/es/BarChart/index.d.mts +11 -0
- package/es/BarChart/index.mjs +290 -0
- package/es/BarChart/index.mjs.map +1 -0
- package/es/BarChart/{renderShape.d.ts → renderShape.d.mts} +3 -1
- package/es/BarChart/renderShape.mjs +28 -0
- package/es/BarChart/renderShape.mjs.map +1 -0
- package/es/BarChart/styles.d.mts +9 -0
- package/es/BarChart/styles.mjs +28 -0
- package/es/BarChart/styles.mjs.map +1 -0
- package/es/BarList/index.d.mts +32 -0
- package/es/BarList/index.mjs +128 -0
- package/es/BarList/index.mjs.map +1 -0
- package/es/BarList/styles.d.mts +13 -0
- package/es/BarList/styles.mjs +63 -0
- package/es/BarList/styles.mjs.map +1 -0
- package/es/BenchmarkColumnChart/index.d.mts +144 -0
- package/es/BenchmarkColumnChart/index.mjs +514 -0
- package/es/BenchmarkColumnChart/index.mjs.map +1 -0
- package/es/BenchmarkColumnChart/styles.d.mts +19 -0
- package/es/BenchmarkColumnChart/styles.mjs +129 -0
- package/es/BenchmarkColumnChart/styles.mjs.map +1 -0
- package/es/BenchmarkRankingChart/index.d.mts +91 -0
- package/es/BenchmarkRankingChart/index.mjs +347 -0
- package/es/BenchmarkRankingChart/index.mjs.map +1 -0
- package/es/BenchmarkRankingChart/styles.d.mts +36 -0
- package/es/BenchmarkRankingChart/styles.mjs +265 -0
- package/es/BenchmarkRankingChart/styles.mjs.map +1 -0
- package/es/BenchmarkScatterChart/index.d.mts +148 -0
- package/es/BenchmarkScatterChart/index.mjs +668 -0
- package/es/BenchmarkScatterChart/index.mjs.map +1 -0
- package/es/BenchmarkScatterChart/styles.d.mts +28 -0
- package/es/BenchmarkScatterChart/styles.mjs +193 -0
- package/es/BenchmarkScatterChart/styles.mjs.map +1 -0
- package/es/BenchmarkScatterChart/{utils.d.ts → utils.d.mts} +32 -29
- package/es/BenchmarkScatterChart/utils.mjs +214 -0
- package/es/BenchmarkScatterChart/utils.mjs.map +1 -0
- package/es/ComposedChart/index.d.mts +6 -0
- package/es/ComposedChart/index.mjs +254 -0
- package/es/ComposedChart/index.mjs.map +1 -0
- package/es/ComposedChart/styles.d.mts +9 -0
- package/es/ComposedChart/styles.mjs +28 -0
- package/es/ComposedChart/styles.mjs.map +1 -0
- package/es/ComposedChart/types.d.mts +71 -0
- package/es/ComposedChart/types.mjs +0 -0
- package/es/DataBars/CategoryBar.d.mts +17 -0
- package/es/DataBars/CategoryBar.mjs +146 -0
- package/es/DataBars/CategoryBar.mjs.map +1 -0
- package/es/DataBars/DeltaBar.d.mts +16 -0
- package/es/DataBars/DeltaBar.mjs +102 -0
- package/es/DataBars/DeltaBar.mjs.map +1 -0
- package/es/DataBars/MarkerBar.d.mts +19 -0
- package/es/DataBars/MarkerBar.mjs +74 -0
- package/es/DataBars/MarkerBar.mjs.map +1 -0
- package/es/DataBars/ProgressBar.d.mts +15 -0
- package/es/DataBars/ProgressBar.mjs +53 -0
- package/es/DataBars/ProgressBar.mjs.map +1 -0
- package/es/DataBars/index.d.mts +5 -0
- package/es/DataBars/index.mjs +5 -0
- package/es/DataBars/styles.d.mts +10 -0
- package/es/DataBars/styles.mjs +31 -0
- package/es/DataBars/styles.mjs.map +1 -0
- package/es/DonutChart/DonutChartTooltip.d.mts +14 -0
- package/es/DonutChart/DonutChartTooltip.mjs +25 -0
- package/es/DonutChart/DonutChartTooltip.mjs.map +1 -0
- package/es/DonutChart/index.d.mts +33 -0
- package/es/DonutChart/index.mjs +160 -0
- package/es/DonutChart/index.mjs.map +1 -0
- package/es/DonutChart/inputParser.d.mts +5 -0
- package/es/DonutChart/inputParser.mjs +8 -0
- package/es/DonutChart/inputParser.mjs.map +1 -0
- package/es/DonutChart/renderInactiveShape.d.mts +4 -0
- package/es/DonutChart/renderInactiveShape.mjs +22 -0
- package/es/DonutChart/renderInactiveShape.mjs.map +1 -0
- package/es/DonutChart/styles.d.mts +9 -0
- package/es/DonutChart/styles.mjs +28 -0
- package/es/DonutChart/styles.mjs.map +1 -0
- package/es/FunnelChart/ArrowRightIcon.d.mts +8 -0
- package/es/FunnelChart/ArrowRightIcon.mjs +14 -0
- package/es/FunnelChart/ArrowRightIcon.mjs.map +1 -0
- package/es/FunnelChart/index.d.mts +21 -0
- package/es/FunnelChart/index.mjs +421 -0
- package/es/FunnelChart/index.mjs.map +1 -0
- package/es/FunnelChart/styles.d.mts +9 -0
- package/es/FunnelChart/styles.mjs +28 -0
- package/es/FunnelChart/styles.mjs.map +1 -0
- package/es/FunnelChart/types.d.mts +31 -0
- package/es/FunnelChart/types.mjs +0 -0
- package/es/Heatmaps/Calendar.d.mts +21 -0
- package/es/Heatmaps/Calendar.mjs +108 -0
- package/es/Heatmaps/Calendar.mjs.map +1 -0
- package/es/Heatmaps/ChartLabels.d.mts +17 -0
- package/es/Heatmaps/ChartLabels.mjs +84 -0
- package/es/Heatmaps/ChartLabels.mjs.map +1 -0
- package/es/Heatmaps/Footer.d.mts +24 -0
- package/es/Heatmaps/Footer.mjs +81 -0
- package/es/Heatmaps/Footer.mjs.map +1 -0
- package/es/Heatmaps/index.d.mts +31 -0
- package/es/Heatmaps/index.mjs +188 -0
- package/es/Heatmaps/index.mjs.map +1 -0
- package/es/Heatmaps/styles.d.mts +10 -0
- package/es/Heatmaps/styles.mjs +47 -0
- package/es/Heatmaps/styles.mjs.map +1 -0
- package/es/Legend/LegendItem.d.mts +12 -0
- package/es/Legend/LegendItem.mjs +65 -0
- package/es/Legend/LegendItem.mjs.map +1 -0
- package/es/Legend/ScrollButton.d.mts +11 -0
- package/es/Legend/ScrollButton.mjs +50 -0
- package/es/Legend/ScrollButton.mjs.map +1 -0
- package/es/Legend/index.d.mts +16 -0
- package/es/Legend/index.mjs +152 -0
- package/es/Legend/index.mjs.map +1 -0
- package/es/LineChart/index.d.mts +11 -0
- package/es/LineChart/index.mjs +271 -0
- package/es/LineChart/index.mjs.map +1 -0
- package/es/LineChart/styles.d.mts +9 -0
- package/es/LineChart/styles.mjs +28 -0
- package/es/LineChart/styles.mjs.map +1 -0
- package/es/RadarChart/index.d.mts +27 -0
- package/es/RadarChart/index.mjs +157 -0
- package/es/RadarChart/index.mjs.map +1 -0
- package/es/RadarChart/styles.d.mts +8 -0
- package/es/RadarChart/styles.mjs +23 -0
- package/es/RadarChart/styles.mjs.map +1 -0
- package/es/ScatterChart/ScatterChartTooltip.d.mts +19 -0
- package/es/ScatterChart/ScatterChartTooltip.mjs +52 -0
- package/es/ScatterChart/ScatterChartTooltip.mjs.map +1 -0
- package/es/ScatterChart/ScatterChartTooltipRow.d.mts +10 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs +36 -0
- package/es/ScatterChart/ScatterChartTooltipRow.mjs.map +1 -0
- package/es/ScatterChart/index.d.mts +58 -0
- package/es/ScatterChart/index.mjs +241 -0
- package/es/ScatterChart/index.mjs.map +1 -0
- package/es/ScatterChart/{renderShape.d.ts → renderShape.d.mts} +4 -1
- package/es/ScatterChart/renderShape.mjs +18 -0
- package/es/ScatterChart/renderShape.mjs.map +1 -0
- package/es/ScatterChart/styles.d.mts +9 -0
- package/es/ScatterChart/styles.mjs +28 -0
- package/es/ScatterChart/styles.mjs.map +1 -0
- package/es/SparkChart/SparkAreaChart.d.mts +14 -0
- package/es/SparkChart/SparkAreaChart.mjs +109 -0
- package/es/SparkChart/SparkAreaChart.mjs.map +1 -0
- package/es/SparkChart/SparkBarChart.d.mts +11 -0
- package/es/SparkChart/SparkBarChart.mjs +69 -0
- package/es/SparkChart/SparkBarChart.mjs.map +1 -0
- package/es/SparkChart/SparkLineChart.d.mts +12 -0
- package/es/SparkChart/SparkLineChart.mjs +73 -0
- package/es/SparkChart/SparkLineChart.mjs.map +1 -0
- package/es/SparkChart/index.d.mts +4 -0
- package/es/SparkChart/index.mjs +4 -0
- package/es/Tracker/TrackerBlock.d.mts +11 -0
- package/es/Tracker/TrackerBlock.mjs +52 -0
- package/es/Tracker/TrackerBlock.mjs.map +1 -0
- package/es/Tracker/index.d.mts +21 -0
- package/es/Tracker/index.mjs +69 -0
- package/es/Tracker/index.mjs.map +1 -0
- package/es/Tracker/styles.d.mts +8 -0
- package/es/Tracker/styles.mjs +24 -0
- package/es/Tracker/styles.mjs.map +1 -0
- package/es/common/BaseAnimationTimingProps.d.mts +10 -0
- package/es/common/BaseAnimationTimingProps.mjs +0 -0
- package/es/common/BaseChartProps.d.mts +61 -0
- package/es/common/BaseChartProps.mjs +0 -0
- package/es/common/BaseSparkChartProps.d.mts +17 -0
- package/es/common/BaseSparkChartProps.mjs +0 -0
- package/es/common/ChartLegend.d.mts +8 -0
- package/es/common/ChartLegend.mjs +32 -0
- package/es/common/ChartLegend.mjs.map +1 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.d.mts +8 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.mjs +27 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.mjs.map +1 -0
- package/es/common/ChartTooltip/ChartTooltipRow.d.mts +10 -0
- package/es/common/ChartTooltip/ChartTooltipRow.mjs +51 -0
- package/es/common/ChartTooltip/ChartTooltipRow.mjs.map +1 -0
- package/es/common/ChartTooltip/index.d.mts +18 -0
- package/es/common/ChartTooltip/index.mjs +50 -0
- package/es/common/ChartTooltip/index.mjs.map +1 -0
- package/es/common/CustomTooltipProps.d.mts +15 -0
- package/es/common/CustomTooltipProps.mjs +0 -0
- package/es/common/CustomYAxisTick.d.mts +18 -0
- package/es/common/CustomYAxisTick.mjs +24 -0
- package/es/common/CustomYAxisTick.mjs.map +1 -0
- package/es/common/NoData.d.mts +13 -0
- package/es/common/NoData.mjs +25 -0
- package/es/common/NoData.mjs.map +1 -0
- package/es/common/benchmark/index.d.mts +3 -0
- package/es/common/benchmark/{index.js → index.mjs} +1 -1
- package/es/common/benchmark/types.d.mts +125 -0
- package/es/common/benchmark/types.mjs +0 -0
- package/es/common/benchmark/{utils.d.ts → utils.d.mts} +38 -36
- package/es/common/benchmark/utils.mjs +115 -0
- package/es/common/benchmark/utils.mjs.map +1 -0
- package/es/common/{utils.d.ts → utils.d.mts} +3 -0
- package/es/common/utils.mjs +36 -0
- package/es/common/utils.mjs.map +1 -0
- package/es/hooks/useOnWindowResize.d.mts +6 -0
- package/es/hooks/useOnWindowResize.mjs +18 -0
- package/es/hooks/useOnWindowResize.mjs.map +1 -0
- package/es/hooks/usePrefersReducedMotion.d.mts +4 -0
- package/es/hooks/usePrefersReducedMotion.mjs +24 -0
- package/es/hooks/usePrefersReducedMotion.mjs.map +1 -0
- package/es/hooks/useThemeColorRange.d.mts +4 -0
- package/es/hooks/useThemeColorRange.mjs +28 -0
- package/es/hooks/useThemeColorRange.mjs.map +1 -0
- package/es/index.d.mts +34 -0
- package/es/index.mjs +28 -0
- package/es/types/{charts.d.ts → charts.d.mts} +26 -26
- package/es/types/charts.mjs +12 -0
- package/es/types/charts.mjs.map +1 -0
- package/es/utils/{calendar.d.ts → calendar.d.mts} +21 -18
- package/es/utils/calendar.mjs +154 -0
- package/es/utils/calendar.mjs.map +1 -0
- package/es/utils/getMaxLabelLength.d.mts +13 -0
- package/es/utils/getMaxLabelLength.mjs +48 -0
- package/es/utils/getMaxLabelLength.mjs.map +1 -0
- package/es/utils/{index.d.ts → index.d.mts} +4 -1
- package/es/utils/index.mjs +19 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/{theme.d.ts → theme.d.mts} +3 -0
- package/es/utils/theme.mjs +33 -0
- package/es/utils/theme.mjs.map +1 -0
- package/package.json +144 -4
- package/es/AccuracyBarChart/index.d.ts +0 -60
- package/es/AccuracyBarChart/index.js +0 -454
- package/es/AccuracyBarChart/index.mdx +0 -52
- package/es/AccuracyBarChart/styles.d.ts +0 -11
- package/es/AccuracyBarChart/styles.js +0 -18
- package/es/AreaChart/index.d.ts +0 -11
- package/es/AreaChart/index.js +0 -430
- package/es/AreaChart/index.mdx +0 -49
- package/es/AreaChart/styles.d.ts +0 -6
- package/es/AreaChart/styles.js +0 -13
- package/es/BarChart/index.d.ts +0 -9
- package/es/BarChart/index.js +0 -392
- package/es/BarChart/index.mdx +0 -73
- package/es/BarChart/renderShape.js +0 -34
- package/es/BarChart/styles.d.ts +0 -6
- package/es/BarChart/styles.js +0 -13
- package/es/BarList/index.d.ts +0 -29
- package/es/BarList/index.js +0 -174
- package/es/BarList/index.mdx +0 -34
- package/es/BarList/styles.d.ts +0 -10
- package/es/BarList/styles.js +0 -18
- package/es/BenchmarkColumnChart/index.d.ts +0 -140
- package/es/BenchmarkColumnChart/index.js +0 -686
- package/es/BenchmarkColumnChart/index.mdx +0 -66
- package/es/BenchmarkColumnChart/styles.d.ts +0 -16
- package/es/BenchmarkColumnChart/styles.js +0 -23
- package/es/BenchmarkRankingChart/index.d.ts +0 -87
- package/es/BenchmarkRankingChart/index.js +0 -455
- package/es/BenchmarkRankingChart/index.mdx +0 -59
- package/es/BenchmarkRankingChart/styles.d.ts +0 -33
- package/es/BenchmarkRankingChart/styles.js +0 -41
- package/es/BenchmarkScatterChart/index.d.ts +0 -145
- package/es/BenchmarkScatterChart/index.js +0 -857
- package/es/BenchmarkScatterChart/index.mdx +0 -61
- package/es/BenchmarkScatterChart/styles.d.ts +0 -25
- package/es/BenchmarkScatterChart/styles.js +0 -33
- package/es/BenchmarkScatterChart/utils.js +0 -353
- package/es/ComposedChart/index.d.ts +0 -5
- package/es/ComposedChart/index.js +0 -335
- package/es/ComposedChart/index.mdx +0 -43
- package/es/ComposedChart/styles.d.ts +0 -6
- package/es/ComposedChart/styles.js +0 -13
- package/es/ComposedChart/types.d.ts +0 -68
- package/es/ComposedChart/types.js +0 -1
- package/es/DataBars/CategoryBar.d.ts +0 -15
- package/es/DataBars/CategoryBar.js +0 -201
- package/es/DataBars/DeltaBar.d.ts +0 -13
- package/es/DataBars/DeltaBar.js +0 -117
- package/es/DataBars/MarkerBar.d.ts +0 -16
- package/es/DataBars/MarkerBar.js +0 -94
- package/es/DataBars/ProgressBar.d.ts +0 -12
- package/es/DataBars/ProgressBar.js +0 -71
- package/es/DataBars/index.d.ts +0 -4
- package/es/DataBars/index.js +0 -4
- package/es/DataBars/index.mdx +0 -36
- package/es/DataBars/styles.d.ts +0 -7
- package/es/DataBars/styles.js +0 -14
- package/es/DonutChart/DonutChartTooltip.d.ts +0 -11
- package/es/DonutChart/DonutChartTooltip.js +0 -26
- package/es/DonutChart/index.d.ts +0 -31
- package/es/DonutChart/index.js +0 -232
- package/es/DonutChart/index.mdx +0 -48
- package/es/DonutChart/inputParser.d.ts +0 -2
- package/es/DonutChart/inputParser.js +0 -9
- package/es/DonutChart/renderInactiveShape.d.ts +0 -2
- package/es/DonutChart/renderInactiveShape.js +0 -27
- package/es/DonutChart/styles.d.ts +0 -6
- package/es/DonutChart/styles.js +0 -13
- package/es/FunnelChart/ArrowRightIcon.d.ts +0 -5
- package/es/FunnelChart/ArrowRightIcon.js +0 -22
- package/es/FunnelChart/index.d.ts +0 -19
- package/es/FunnelChart/index.js +0 -499
- package/es/FunnelChart/index.mdx +0 -21
- package/es/FunnelChart/styles.d.ts +0 -6
- package/es/FunnelChart/styles.js +0 -13
- package/es/FunnelChart/types.d.ts +0 -28
- package/es/FunnelChart/types.js +0 -1
- package/es/Heatmaps/Calendar.d.ts +0 -18
- package/es/Heatmaps/Calendar.js +0 -155
- package/es/Heatmaps/ChartLabels.d.ts +0 -15
- package/es/Heatmaps/ChartLabels.js +0 -106
- package/es/Heatmaps/Footer.d.ts +0 -22
- package/es/Heatmaps/Footer.js +0 -105
- package/es/Heatmaps/index.d.ts +0 -28
- package/es/Heatmaps/index.js +0 -227
- package/es/Heatmaps/index.mdx +0 -70
- package/es/Heatmaps/styles.d.ts +0 -7
- package/es/Heatmaps/styles.js +0 -14
- package/es/Legend/LegendItem.d.ts +0 -10
- package/es/Legend/LegendItem.js +0 -58
- package/es/Legend/ScrollButton.d.ts +0 -9
- package/es/Legend/ScrollButton.js +0 -63
- package/es/Legend/index.d.ts +0 -14
- package/es/Legend/index.js +0 -184
- package/es/Legend/index.mdx +0 -13
- package/es/LineChart/index.d.ts +0 -9
- package/es/LineChart/index.js +0 -388
- package/es/LineChart/index.mdx +0 -49
- package/es/LineChart/styles.d.ts +0 -6
- package/es/LineChart/styles.js +0 -13
- package/es/RadarChart/index.d.ts +0 -24
- package/es/RadarChart/index.js +0 -254
- package/es/RadarChart/index.mdx +0 -52
- package/es/RadarChart/styles.d.ts +0 -5
- package/es/RadarChart/styles.js +0 -12
- package/es/ScatterChart/ScatterChartTooltip.d.ts +0 -16
- package/es/ScatterChart/ScatterChartTooltip.js +0 -76
- package/es/ScatterChart/ScatterChartTooltipRow.d.ts +0 -7
- package/es/ScatterChart/ScatterChartTooltipRow.js +0 -40
- package/es/ScatterChart/index.d.ts +0 -56
- package/es/ScatterChart/index.js +0 -342
- package/es/ScatterChart/index.mdx +0 -49
- package/es/ScatterChart/renderShape.js +0 -18
- package/es/ScatterChart/styles.d.ts +0 -6
- package/es/ScatterChart/styles.js +0 -13
- package/es/SparkChart/SparkAreaChart.d.ts +0 -12
- package/es/SparkChart/SparkAreaChart.js +0 -148
- package/es/SparkChart/SparkBarChart.d.ts +0 -9
- package/es/SparkChart/SparkBarChart.js +0 -106
- package/es/SparkChart/SparkLineChart.d.ts +0 -10
- package/es/SparkChart/SparkLineChart.js +0 -110
- package/es/SparkChart/index.d.ts +0 -3
- package/es/SparkChart/index.js +0 -3
- package/es/SparkChart/index.mdx +0 -29
- package/es/Tracker/TrackerBlock.d.ts +0 -8
- package/es/Tracker/TrackerBlock.js +0 -64
- package/es/Tracker/index.d.ts +0 -18
- package/es/Tracker/index.js +0 -105
- package/es/Tracker/index.mdx +0 -41
- package/es/Tracker/styles.d.ts +0 -5
- package/es/Tracker/styles.js +0 -12
- package/es/common/BaseAnimationTimingProps.d.ts +0 -7
- package/es/common/BaseAnimationTimingProps.js +0 -1
- package/es/common/BaseChartProps.d.ts +0 -58
- package/es/common/BaseChartProps.js +0 -1
- package/es/common/BaseSparkChartProps.d.ts +0 -14
- package/es/common/BaseSparkChartProps.js +0 -1
- package/es/common/ChartLegend.d.ts +0 -5
- package/es/common/ChartLegend.js +0 -40
- package/es/common/ChartTooltip/ChartTooltipFrame.d.ts +0 -6
- package/es/common/ChartTooltip/ChartTooltipFrame.js +0 -32
- package/es/common/ChartTooltip/ChartTooltipRow.d.ts +0 -8
- package/es/common/ChartTooltip/ChartTooltipRow.js +0 -55
- package/es/common/ChartTooltip/index.d.ts +0 -15
- package/es/common/ChartTooltip/index.js +0 -66
- package/es/common/CustomTooltipProps.d.ts +0 -12
- package/es/common/CustomTooltipProps.js +0 -1
- package/es/common/CustomYAxisTick.d.ts +0 -15
- package/es/common/CustomYAxisTick.js +0 -27
- package/es/common/NoData.d.ts +0 -10
- package/es/common/NoData.js +0 -24
- package/es/common/benchmark/index.d.ts +0 -2
- package/es/common/benchmark/types.d.ts +0 -122
- package/es/common/benchmark/types.js +0 -1
- package/es/common/benchmark/utils.js +0 -159
- package/es/common/utils.js +0 -85
- package/es/hooks/useOnWindowResize.d.ts +0 -3
- package/es/hooks/useOnWindowResize.js +0 -15
- package/es/hooks/usePrefersReducedMotion.d.ts +0 -1
- package/es/hooks/usePrefersReducedMotion.js +0 -28
- package/es/hooks/useThemeColorRange.d.ts +0 -1
- package/es/hooks/useThemeColorRange.js +0 -8
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -22
- package/es/types/charts.js +0 -8
- package/es/types/global.d.ts +0 -9
- package/es/utils/calendar.js +0 -199
- package/es/utils/getMaxLabelLength.d.ts +0 -10
- package/es/utils/getMaxLabelLength.js +0 -110
- package/es/utils/index.js +0 -32
- package/es/utils/theme.js +0 -40
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: BenchmarkColumnChart
|
|
3
|
-
description: Vertical column chart for model benchmark comparisons with injectable brand icons and rotated labels.
|
|
4
|
-
category: Benchmark
|
|
5
|
-
order: 3
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
-
import DemoAccuracy from './demos/accuracy.tsx?demo';
|
|
10
|
-
import DemoLine from './demos/line.tsx?demo';
|
|
11
|
-
import DemoHighlighted from './demos/highlighted.tsx?demo';
|
|
12
|
-
|
|
13
|
-
<Demo of={DemoIndex} layout="bare" />
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
Icons and brand colors are provided by the consumer. `@lobehub/icons` is only used in docs demos and is not a runtime dependency of `@lobehub/charts`.
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
import { BenchmarkColumnChart } from '@lobehub/charts';
|
|
21
|
-
import { Claude, OpenAI } from '@lobehub/icons';
|
|
22
|
-
|
|
23
|
-
export default () => (
|
|
24
|
-
<BenchmarkColumnChart
|
|
25
|
-
data={[
|
|
26
|
-
{
|
|
27
|
-
color: Claude.colorPrimary,
|
|
28
|
-
icon: <Claude.Avatar size={20} />,
|
|
29
|
-
name: 'Claude Fable 5.1\n(max with fallback)',
|
|
30
|
-
provider: 'Anthropic',
|
|
31
|
-
score: 57,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
color: OpenAI.colorPrimary,
|
|
35
|
-
icon: <OpenAI.Avatar size={20} />,
|
|
36
|
-
name: 'GPT-6 Astra\n(max)',
|
|
37
|
-
provider: 'OpenAI',
|
|
38
|
-
score: 55,
|
|
39
|
-
},
|
|
40
|
-
]}
|
|
41
|
-
height={360}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Accuracy with error bars
|
|
47
|
-
|
|
48
|
-
Use `accuracyFormatter`, `error`, and `showErrorBars` for AccuracyBar-style percentage and ± uncertainty display.
|
|
49
|
-
|
|
50
|
-
<Demo of={DemoAccuracy} />
|
|
51
|
-
|
|
52
|
-
## Line overlay + unranked
|
|
53
|
-
|
|
54
|
-
Pass a secondary `line` value to draw an overlay series (e.g. Pass¹). Mark items with `unranked: true` to place them after a dashed separator — the line does not connect into unranked points. Override color with `lineColor` (defaults to `theme.gold`). Pass `false` or `''` for `barName` / `lineName` / `unrankedLabel` to hide that header item.
|
|
55
|
-
|
|
56
|
-
<Demo of={DemoLine} />
|
|
57
|
-
|
|
58
|
-
## Highlighted items
|
|
59
|
-
|
|
60
|
-
Set `highlighted: true` on a record to accent its axis label / rank with `highlightColor` (defaults to `theme.gold`). Bar fill colors are unchanged.
|
|
61
|
-
|
|
62
|
-
<Demo of={DemoHighlighted} />
|
|
63
|
-
|
|
64
|
-
## API
|
|
65
|
-
|
|
66
|
-
<Api name="BenchmarkColumnChart" />
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const styles: {
|
|
2
|
-
chartHeader: string;
|
|
3
|
-
container: string;
|
|
4
|
-
gridLines: string;
|
|
5
|
-
iconWrap: string;
|
|
6
|
-
label: string;
|
|
7
|
-
legend: string;
|
|
8
|
-
legendBars: string;
|
|
9
|
-
legendItem: string;
|
|
10
|
-
legendLine: string;
|
|
11
|
-
lineLabel: string;
|
|
12
|
-
rank: string;
|
|
13
|
-
tickLabel: string;
|
|
14
|
-
unrankedLabel: string;
|
|
15
|
-
valueLabel: string;
|
|
16
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
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 'antd-style';
|
|
4
|
-
export var styles = createStaticStyles(function (_ref) {
|
|
5
|
-
var css = _ref.css,
|
|
6
|
-
cssVar = _ref.cssVar;
|
|
7
|
-
return {
|
|
8
|
-
chartHeader: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 2;\n top: 8px;\n right: 0;\n left: 0;\n\n display: flex;\n gap: 16px;\n align-items: flex-start;\n justify-content: space-between;\n\n padding-inline: var(--benchmark-header-pad-inline, 48px);\n "]))),
|
|
9
|
-
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: auto visible;\n\n .recharts-wrapper,\n .recharts-surface {\n overflow: visible;\n }\n\n /* stylelint-disable-next-line selector-class-pattern -- recharts internal class */\n .recharts-errorBar {\n mix-blend-mode: difference;\n }\n "]))),
|
|
10
|
-
gridLines: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n stroke: ", ";\n stroke-dasharray: 4 4;\n stroke-width: 1;\n "])), cssVar.colorBorderSecondary),
|
|
11
|
-
iconWrap: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: visible;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
|
|
12
|
-
label: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: 12px;\n line-height: 16px;\n fill: ", ";\n "])), cssVar.colorTextDescription),
|
|
13
|
-
legend: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row wrap;\n gap: 6px 16px;\n align-items: center;\n\n min-width: 0;\n\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n "])), cssVar.colorTextSecondary),
|
|
14
|
-
legendBars: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: inline-block;\n width: 14px;\n height: 10px;\n border-radius: 2px;\n "]))),
|
|
15
|
-
legendItem: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: inline-flex;\n flex-shrink: 0;\n gap: 6px;\n align-items: center;\n "]))),
|
|
16
|
-
legendLine: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: inline-block;\n width: 16px;\n height: 0;\n border-top: 2px solid ", ";\n "])), cssVar.colorTextSecondary),
|
|
17
|
-
lineLabel: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n pointer-events: none;\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-weight: 500;\n "]))),
|
|
18
|
-
rank: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: 14px;\n font-variant-numeric: tabular-nums;\n line-height: 1.3;\n color: ", ";\n text-align: left;\n\n fill: ", ";\n "])), cssVar.colorTextQuaternary, cssVar.colorTextQuaternary),
|
|
19
|
-
tickLabel: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n font-size: var(--benchmark-label-font-size, 11px);\n line-height: 1.25;\n fill: ", ";\n "])), cssVar.colorTextSecondary),
|
|
20
|
-
unrankedLabel: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n\n max-width: 42%;\n\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n text-align: right;\n "])), cssVar.colorTextDescription),
|
|
21
|
-
valueLabel: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n pointer-events: none;\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: var(--benchmark-value-label-font-size, 12px);\n font-weight: 600;\n "])))
|
|
22
|
-
};
|
|
23
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type BenchmarkBaseProps, type NormalizedBenchmarkItem } from "../common/benchmark";
|
|
3
|
-
export interface BenchmarkRankingChartProps extends BenchmarkBaseProps {
|
|
4
|
-
/**
|
|
5
|
-
* Thickness of the horizontal score bar
|
|
6
|
-
* @default 24
|
|
7
|
-
*/
|
|
8
|
-
barSize?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Fallback bar color when an item has no color
|
|
11
|
-
*/
|
|
12
|
-
color?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Text accent color when an item has `highlighted: true` (does not change bar fill)
|
|
15
|
-
* @default theme.gold
|
|
16
|
-
*/
|
|
17
|
-
highlightColor?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Font size for the model name
|
|
20
|
-
* @default 14
|
|
21
|
-
*/
|
|
22
|
-
labelFontSize?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Display width of the left label (icon + name + provider).
|
|
25
|
-
* Omit to size to the longest label.
|
|
26
|
-
*/
|
|
27
|
-
labelWidth?: number | string;
|
|
28
|
-
/**
|
|
29
|
-
* Override domain max used for bar scaling
|
|
30
|
-
*/
|
|
31
|
-
maxValue?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Custom rank renderer. Receives the normalized item; default is `#${rank}`.
|
|
34
|
-
*/
|
|
35
|
-
renderRank?: (item: NormalizedBenchmarkItem) => ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* Height of each ranking row
|
|
38
|
-
* @default 40
|
|
39
|
-
*/
|
|
40
|
-
rowHeight?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Show AccuracyBar-style horizontal error bars
|
|
43
|
-
* @default true
|
|
44
|
-
*/
|
|
45
|
-
showErrorBars?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Show vertical grid lines in the plot
|
|
48
|
-
* @default true
|
|
49
|
-
*/
|
|
50
|
-
showGridLines?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Show rank on the left (default `#1`, `#2`, ...)
|
|
53
|
-
* @default true
|
|
54
|
-
*/
|
|
55
|
-
showRank?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Show tooltip on row hover
|
|
58
|
-
* @default true
|
|
59
|
-
*/
|
|
60
|
-
showTooltip?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Show numeric score labels on the right
|
|
63
|
-
* @default true
|
|
64
|
-
*/
|
|
65
|
-
showValueLabel?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Show X value axis line + ticks under the bars
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
showXAxis?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Show Y axis line along the plot
|
|
73
|
-
* @default true
|
|
74
|
-
*/
|
|
75
|
-
showYAxis?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Font size for the numeric score
|
|
78
|
-
* @default 14
|
|
79
|
-
*/
|
|
80
|
-
valueLabelFontSize?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Optional X axis title under the ticks
|
|
83
|
-
*/
|
|
84
|
-
xAxisLabel?: string;
|
|
85
|
-
}
|
|
86
|
-
declare const BenchmarkRankingChart: import("react").ForwardRefExoticComponent<BenchmarkRankingChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
87
|
-
export default BenchmarkRankingChart;
|
|
@@ -1,455 +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 _excluded = ["data", "index", "valueKey", "providerKey", "iconKey", "colorKey", "errorKey", "renderIcon", "color", "highlightColor", "valueFormatter", "accuracyFormatter", "errorFormatter", "showError", "showErrorBars", "showAnimation", "onValueChange", "sortOrder", "className", "style", "loading", "width", "height", "noDataText", "barSize", "rowHeight", "labelWidth", "labelFontSize", "valueLabelFontSize", "maxValue", "renderRank", "showRank", "showValueLabel", "showTooltip", "showGridLines", "showXAxis", "showYAxis", "xAxisLabel"];
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
-
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); }
|
|
10
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
-
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."); }
|
|
12
|
-
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; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
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); }
|
|
19
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
20
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
-
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; }
|
|
22
|
-
import { A, Flexbox } from '@lobehub/ui';
|
|
23
|
-
import { Skeleton, Tooltip } from '@lobehub/ui/base-ui';
|
|
24
|
-
import { cssVar, cx, useTheme } from 'antd-style';
|
|
25
|
-
import { forwardRef, useMemo, useState } from 'react';
|
|
26
|
-
import ChartTooltip from "../common/ChartTooltip";
|
|
27
|
-
import NoData from "../common/NoData";
|
|
28
|
-
import { defaultBenchmarkErrorFormatter, defaultBenchmarkValueFormatter, formatBenchmarkAccuracyDisplay, getBenchmarkBarPercent, normalizeBenchmarkData } from "../common/benchmark";
|
|
29
|
-
import { styles } from "./styles";
|
|
30
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
|
-
var prefixCls = 'ant';
|
|
34
|
-
var getAxisTicks = function getAxisTicks(max) {
|
|
35
|
-
var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
36
|
-
if (max <= 0) return [0];
|
|
37
|
-
var raw = max / count;
|
|
38
|
-
var magnitude = Math.pow(10, Math.floor(Math.log10(raw)));
|
|
39
|
-
var normalized = raw / magnitude;
|
|
40
|
-
var stepBase = normalized <= 1 ? 1 : normalized <= 2 ? 2 : normalized <= 5 ? 5 : 10;
|
|
41
|
-
var step = stepBase * magnitude;
|
|
42
|
-
var ticks = [];
|
|
43
|
-
for (var value = 0; value <= max + step / 1000; value += step) {
|
|
44
|
-
ticks.push(Math.min(Number(value.toFixed(6)), max));
|
|
45
|
-
}
|
|
46
|
-
if (ticks.at(-1) !== max) ticks.push(max);
|
|
47
|
-
return _toConsumableArray(new Set(ticks));
|
|
48
|
-
};
|
|
49
|
-
var BenchmarkRankingChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
50
|
-
var theme = useTheme();
|
|
51
|
-
var _props$data = props.data,
|
|
52
|
-
data = _props$data === void 0 ? [] : _props$data,
|
|
53
|
-
index = props.index,
|
|
54
|
-
valueKey = props.valueKey,
|
|
55
|
-
providerKey = props.providerKey,
|
|
56
|
-
iconKey = props.iconKey,
|
|
57
|
-
colorKey = props.colorKey,
|
|
58
|
-
errorKey = props.errorKey,
|
|
59
|
-
renderIcon = props.renderIcon,
|
|
60
|
-
_props$color = props.color,
|
|
61
|
-
color = _props$color === void 0 ? cssVar.colorPrimary : _props$color,
|
|
62
|
-
highlightColor = props.highlightColor,
|
|
63
|
-
_props$valueFormatter = props.valueFormatter,
|
|
64
|
-
valueFormatter = _props$valueFormatter === void 0 ? defaultBenchmarkValueFormatter : _props$valueFormatter,
|
|
65
|
-
accuracyFormatter = props.accuracyFormatter,
|
|
66
|
-
_props$errorFormatter = props.errorFormatter,
|
|
67
|
-
errorFormatter = _props$errorFormatter === void 0 ? defaultBenchmarkErrorFormatter : _props$errorFormatter,
|
|
68
|
-
_props$showError = props.showError,
|
|
69
|
-
showError = _props$showError === void 0 ? true : _props$showError,
|
|
70
|
-
_props$showErrorBars = props.showErrorBars,
|
|
71
|
-
showErrorBars = _props$showErrorBars === void 0 ? true : _props$showErrorBars,
|
|
72
|
-
_props$showAnimation = props.showAnimation,
|
|
73
|
-
showAnimation = _props$showAnimation === void 0 ? false : _props$showAnimation,
|
|
74
|
-
onValueChange = props.onValueChange,
|
|
75
|
-
_props$sortOrder = props.sortOrder,
|
|
76
|
-
sortOrder = _props$sortOrder === void 0 ? 'descending' : _props$sortOrder,
|
|
77
|
-
className = props.className,
|
|
78
|
-
style = props.style,
|
|
79
|
-
loading = props.loading,
|
|
80
|
-
_props$width = props.width,
|
|
81
|
-
width = _props$width === void 0 ? '100%' : _props$width,
|
|
82
|
-
height = props.height,
|
|
83
|
-
noDataText = props.noDataText,
|
|
84
|
-
_props$barSize = props.barSize,
|
|
85
|
-
barSize = _props$barSize === void 0 ? 24 : _props$barSize,
|
|
86
|
-
_props$rowHeight = props.rowHeight,
|
|
87
|
-
rowHeight = _props$rowHeight === void 0 ? 40 : _props$rowHeight,
|
|
88
|
-
labelWidth = props.labelWidth,
|
|
89
|
-
_props$labelFontSize = props.labelFontSize,
|
|
90
|
-
labelFontSize = _props$labelFontSize === void 0 ? 14 : _props$labelFontSize,
|
|
91
|
-
_props$valueLabelFont = props.valueLabelFontSize,
|
|
92
|
-
valueLabelFontSize = _props$valueLabelFont === void 0 ? 14 : _props$valueLabelFont,
|
|
93
|
-
maxValue = props.maxValue,
|
|
94
|
-
renderRank = props.renderRank,
|
|
95
|
-
_props$showRank = props.showRank,
|
|
96
|
-
showRank = _props$showRank === void 0 ? true : _props$showRank,
|
|
97
|
-
_props$showValueLabel = props.showValueLabel,
|
|
98
|
-
showValueLabel = _props$showValueLabel === void 0 ? true : _props$showValueLabel,
|
|
99
|
-
_props$showTooltip = props.showTooltip,
|
|
100
|
-
showTooltip = _props$showTooltip === void 0 ? true : _props$showTooltip,
|
|
101
|
-
_props$showGridLines = props.showGridLines,
|
|
102
|
-
showGridLines = _props$showGridLines === void 0 ? true : _props$showGridLines,
|
|
103
|
-
_props$showXAxis = props.showXAxis,
|
|
104
|
-
showXAxis = _props$showXAxis === void 0 ? false : _props$showXAxis,
|
|
105
|
-
_props$showYAxis = props.showYAxis,
|
|
106
|
-
showYAxis = _props$showYAxis === void 0 ? true : _props$showYAxis,
|
|
107
|
-
xAxisLabel = props.xAxisLabel,
|
|
108
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
109
|
-
var resolvedHighlightColor = highlightColor !== null && highlightColor !== void 0 ? highlightColor : theme.gold;
|
|
110
|
-
var _useState = useState(),
|
|
111
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
112
|
-
activeKey = _useState2[0],
|
|
113
|
-
setActiveKey = _useState2[1];
|
|
114
|
-
var enableErrorBars = showError && showErrorBars;
|
|
115
|
-
var displayFormatter = accuracyFormatter !== null && accuracyFormatter !== void 0 ? accuracyFormatter : valueFormatter;
|
|
116
|
-
var items = useMemo(function () {
|
|
117
|
-
return normalizeBenchmarkData({
|
|
118
|
-
colorKey: colorKey,
|
|
119
|
-
data: data,
|
|
120
|
-
errorKey: errorKey,
|
|
121
|
-
iconKey: iconKey,
|
|
122
|
-
index: index,
|
|
123
|
-
providerKey: providerKey,
|
|
124
|
-
renderIcon: renderIcon,
|
|
125
|
-
sortOrder: sortOrder,
|
|
126
|
-
valueKey: valueKey
|
|
127
|
-
});
|
|
128
|
-
}, [colorKey, data, errorKey, iconKey, index, providerKey, renderIcon, sortOrder, valueKey]);
|
|
129
|
-
var resolvedMaxValue = useMemo(function () {
|
|
130
|
-
if (typeof maxValue === 'number') return maxValue;
|
|
131
|
-
return Math.max.apply(Math, _toConsumableArray(items.map(function (item) {
|
|
132
|
-
var _item$error;
|
|
133
|
-
return item.value + (enableErrorBars ? (_item$error = item.error) !== null && _item$error !== void 0 ? _item$error : 0 : 0);
|
|
134
|
-
})).concat([0]));
|
|
135
|
-
}, [enableErrorBars, items, maxValue]);
|
|
136
|
-
var axisTicks = useMemo(function () {
|
|
137
|
-
return getAxisTicks(resolvedMaxValue);
|
|
138
|
-
}, [resolvedMaxValue]);
|
|
139
|
-
var hasLabelWidth = labelWidth !== undefined && labelWidth !== null && labelWidth !== '';
|
|
140
|
-
var labelWidthStyle = typeof labelWidth === 'number' ? "".concat(labelWidth, "px") : labelWidth;
|
|
141
|
-
var gridTicks = axisTicks.filter(function (tick) {
|
|
142
|
-
return tick > 0 && tick < resolvedMaxValue;
|
|
143
|
-
});
|
|
144
|
-
if (loading || !data) return /*#__PURE__*/_jsx(Skeleton, {
|
|
145
|
-
height: height !== null && height !== void 0 ? height : 280,
|
|
146
|
-
width: width
|
|
147
|
-
});
|
|
148
|
-
var handleClick = function handleClick(item) {
|
|
149
|
-
if (!onValueChange) return;
|
|
150
|
-
if (activeKey === item.key) {
|
|
151
|
-
setActiveKey(undefined);
|
|
152
|
-
onValueChange(null);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
setActiveKey(item.key);
|
|
156
|
-
var payload = _objectSpread(_objectSpread({}, item.original), {}, {
|
|
157
|
-
eventType: 'row',
|
|
158
|
-
rank: item.rank,
|
|
159
|
-
value: item.value
|
|
160
|
-
});
|
|
161
|
-
onValueChange(payload);
|
|
162
|
-
};
|
|
163
|
-
var renderRowTooltip = function renderRowTooltip(item, child, key) {
|
|
164
|
-
var _item$color;
|
|
165
|
-
var fillTrigger = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
166
|
-
var trigger = /*#__PURE__*/_jsx("div", {
|
|
167
|
-
className: styles.tooltipTrigger,
|
|
168
|
-
style: fillTrigger ? undefined : {
|
|
169
|
-
minWidth: 'max-content',
|
|
170
|
-
width: 'auto'
|
|
171
|
-
},
|
|
172
|
-
children: child
|
|
173
|
-
});
|
|
174
|
-
if (!showTooltip) return /*#__PURE__*/_jsx("div", {
|
|
175
|
-
children: trigger
|
|
176
|
-
}, key);
|
|
177
|
-
var modelName = String(item.name).replaceAll('\n', ' ');
|
|
178
|
-
var metricName = accuracyFormatter ? 'Accuracy' : 'Score';
|
|
179
|
-
var title = item.provider ? String(item.provider) : metricName;
|
|
180
|
-
var swatch = (_item$color = item.color) !== null && _item$color !== void 0 ? _item$color : color;
|
|
181
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
182
|
-
arrow: false,
|
|
183
|
-
mouseEnterDelay: 0.05,
|
|
184
|
-
styles: {
|
|
185
|
-
container: {
|
|
186
|
-
background: 'transparent',
|
|
187
|
-
boxShadow: 'none',
|
|
188
|
-
maxWidth: 'none',
|
|
189
|
-
padding: 0,
|
|
190
|
-
width: 'max-content'
|
|
191
|
-
},
|
|
192
|
-
content: {
|
|
193
|
-
color: cssVar.colorText,
|
|
194
|
-
fontSize: cssVar.fontSize,
|
|
195
|
-
lineHeight: cssVar.lineHeight,
|
|
196
|
-
maxWidth: 'none',
|
|
197
|
-
overflow: 'visible',
|
|
198
|
-
padding: 0
|
|
199
|
-
},
|
|
200
|
-
root: {
|
|
201
|
-
maxWidth: 'none'
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
title: /*#__PURE__*/_jsx(ChartTooltip, {
|
|
205
|
-
active: true,
|
|
206
|
-
categoryColors: new Map([[modelName, swatch]]),
|
|
207
|
-
label: title,
|
|
208
|
-
payload: [{
|
|
209
|
-
color: swatch,
|
|
210
|
-
dataKey: '__value',
|
|
211
|
-
name: modelName,
|
|
212
|
-
value: item.value
|
|
213
|
-
}],
|
|
214
|
-
valueFormatter: function valueFormatter(val) {
|
|
215
|
-
if (!showError || item.error === undefined || item.error === null) {
|
|
216
|
-
return displayFormatter(Number(val));
|
|
217
|
-
}
|
|
218
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
219
|
-
children: [displayFormatter(Number(val)), /*#__PURE__*/_jsxs("span", {
|
|
220
|
-
style: {
|
|
221
|
-
color: cssVar.colorTextSecondary
|
|
222
|
-
},
|
|
223
|
-
children: [' ', "\xB1 ", errorFormatter(Number(item.error))]
|
|
224
|
-
})]
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}),
|
|
228
|
-
children: trigger
|
|
229
|
-
}, key);
|
|
230
|
-
};
|
|
231
|
-
var toPercent = function toPercent(value) {
|
|
232
|
-
return resolvedMaxValue <= 0 ? 0 : Math.max(0, Math.min(100, value / resolvedMaxValue * 100));
|
|
233
|
-
};
|
|
234
|
-
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
235
|
-
className: cx(styles.container, className),
|
|
236
|
-
gap: 0,
|
|
237
|
-
horizontal: true,
|
|
238
|
-
ref: ref,
|
|
239
|
-
style: _objectSpread({
|
|
240
|
-
'--benchmark-label-font-size': "".concat(labelFontSize, "px"),
|
|
241
|
-
'--benchmark-subtitle-font-size': "".concat(Math.max(10, labelFontSize - 2), "px"),
|
|
242
|
-
'--benchmark-value-label-font-size': "".concat(valueLabelFontSize, "px"),
|
|
243
|
-
'minHeight': height,
|
|
244
|
-
'position': 'relative'
|
|
245
|
-
}, style),
|
|
246
|
-
width: width
|
|
247
|
-
}, rest), {}, {
|
|
248
|
-
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
249
|
-
className: styles.labelColumn,
|
|
250
|
-
gap: 8,
|
|
251
|
-
style: {
|
|
252
|
-
flex: hasLabelWidth ? "0 0 ".concat(labelWidthStyle) : '0 0 auto',
|
|
253
|
-
minWidth: hasLabelWidth ? 0 : 'max-content',
|
|
254
|
-
width: hasLabelWidth ? labelWidthStyle : 'auto'
|
|
255
|
-
},
|
|
256
|
-
width: hasLabelWidth ? labelWidth : 'auto',
|
|
257
|
-
children: [items.map(function (item) {
|
|
258
|
-
var textColor = item.highlighted ? resolvedHighlightColor : undefined;
|
|
259
|
-
return renderRowTooltip(item, /*#__PURE__*/_jsxs(Flexbox, {
|
|
260
|
-
align: "center",
|
|
261
|
-
className: styles.labelRow,
|
|
262
|
-
height: rowHeight,
|
|
263
|
-
horizontal: true,
|
|
264
|
-
onClick: function onClick() {
|
|
265
|
-
return handleClick(item);
|
|
266
|
-
},
|
|
267
|
-
style: {
|
|
268
|
-
cursor: onValueChange ? 'pointer' : 'default'
|
|
269
|
-
},
|
|
270
|
-
width: "100%",
|
|
271
|
-
children: [showRank ? /*#__PURE__*/_jsx("div", {
|
|
272
|
-
className: styles.rank,
|
|
273
|
-
style: textColor ? {
|
|
274
|
-
color: textColor
|
|
275
|
-
} : undefined,
|
|
276
|
-
children: renderRank ? renderRank(item) : "#".concat(item.rank)
|
|
277
|
-
}) : null, /*#__PURE__*/_jsxs(Flexbox, {
|
|
278
|
-
className: styles.identity,
|
|
279
|
-
horizontal: true,
|
|
280
|
-
children: [item.icon ? /*#__PURE__*/_jsx("div", {
|
|
281
|
-
className: styles.icon,
|
|
282
|
-
children: item.icon
|
|
283
|
-
}) : null, /*#__PURE__*/_jsxs("div", {
|
|
284
|
-
className: styles.labelStack,
|
|
285
|
-
children: [item.href ? /*#__PURE__*/_jsx(A, {
|
|
286
|
-
className: cx(styles.nameLink, styles.emphasis),
|
|
287
|
-
href: item.href,
|
|
288
|
-
onClick: function onClick(event) {
|
|
289
|
-
return event.stopPropagation();
|
|
290
|
-
},
|
|
291
|
-
style: textColor ? {
|
|
292
|
-
color: textColor
|
|
293
|
-
} : undefined,
|
|
294
|
-
target: item.target,
|
|
295
|
-
children: item.name
|
|
296
|
-
}) : /*#__PURE__*/_jsx("div", {
|
|
297
|
-
className: cx(styles.name, styles.emphasis),
|
|
298
|
-
style: textColor ? {
|
|
299
|
-
color: textColor
|
|
300
|
-
} : undefined,
|
|
301
|
-
children: item.name
|
|
302
|
-
}), item.provider ? /*#__PURE__*/_jsx("div", {
|
|
303
|
-
className: cx(styles.provider, styles.emphasis),
|
|
304
|
-
style: textColor ? {
|
|
305
|
-
color: textColor
|
|
306
|
-
} : undefined,
|
|
307
|
-
children: item.provider
|
|
308
|
-
}) : null]
|
|
309
|
-
})]
|
|
310
|
-
})]
|
|
311
|
-
}), "label-".concat(item.key), hasLabelWidth);
|
|
312
|
-
}), showXAxis ? /*#__PURE__*/_jsx("div", {
|
|
313
|
-
className: styles.axisLabelSpacer,
|
|
314
|
-
style: {
|
|
315
|
-
minHeight: xAxisLabel ? 44 : 28
|
|
316
|
-
}
|
|
317
|
-
}) : null]
|
|
318
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
319
|
-
className: styles.plot,
|
|
320
|
-
children: [showYAxis ? /*#__PURE__*/_jsx("div", {
|
|
321
|
-
className: styles.yAxisLine,
|
|
322
|
-
style: {
|
|
323
|
-
bottom: showXAxis ? xAxisLabel ? 44 : 28 : 0
|
|
324
|
-
}
|
|
325
|
-
}) : null, showGridLines ? gridTicks.map(function (tick) {
|
|
326
|
-
return /*#__PURE__*/_jsx("div", {
|
|
327
|
-
className: styles.gridLine,
|
|
328
|
-
style: {
|
|
329
|
-
bottom: showXAxis ? xAxisLabel ? 44 : 28 : 0,
|
|
330
|
-
left: "".concat(toPercent(tick), "%")
|
|
331
|
-
}
|
|
332
|
-
}, "grid-".concat(tick));
|
|
333
|
-
}) : null, /*#__PURE__*/_jsx(Flexbox, {
|
|
334
|
-
className: styles.plotRows,
|
|
335
|
-
gap: 8,
|
|
336
|
-
role: "list",
|
|
337
|
-
children: items.map(function (item) {
|
|
338
|
-
var _item$color2;
|
|
339
|
-
var barColor = (_item$color2 = item.color) !== null && _item$color2 !== void 0 ? _item$color2 : color;
|
|
340
|
-
var percent = getBenchmarkBarPercent(item.value, resolvedMaxValue);
|
|
341
|
-
var isActive = activeKey === item.key;
|
|
342
|
-
var display = formatBenchmarkAccuracyDisplay({
|
|
343
|
-
accuracyFormatter: accuracyFormatter,
|
|
344
|
-
error: item.error,
|
|
345
|
-
errorFormatter: errorFormatter,
|
|
346
|
-
showError: showError,
|
|
347
|
-
value: item.value,
|
|
348
|
-
valueFormatter: valueFormatter
|
|
349
|
-
});
|
|
350
|
-
var errorPct = enableErrorBars && item.error !== undefined && item.error !== null ? toPercent(item.error) : 0;
|
|
351
|
-
var errorLeft = Math.max(0, percent - errorPct);
|
|
352
|
-
var errorWidth = Math.min(100 - errorLeft, errorPct * 2);
|
|
353
|
-
return renderRowTooltip(item, /*#__PURE__*/_jsx(Flexbox, {
|
|
354
|
-
"aria-label": "Rank ".concat(item.rank, ": ").concat(String(item.name)).concat(item.provider ? " by ".concat(String(item.provider)) : '', ", score ").concat(display.text),
|
|
355
|
-
className: cx(styles.plotRow, onValueChange && styles.barHover),
|
|
356
|
-
height: rowHeight,
|
|
357
|
-
onClick: function onClick() {
|
|
358
|
-
return handleClick(item);
|
|
359
|
-
},
|
|
360
|
-
role: 'listitem',
|
|
361
|
-
style: {
|
|
362
|
-
cursor: onValueChange || showTooltip ? 'pointer' : 'default',
|
|
363
|
-
opacity: activeKey && !isActive ? 0.55 : 1
|
|
364
|
-
},
|
|
365
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
366
|
-
className: styles.barTrack,
|
|
367
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
368
|
-
className: cx("".concat(prefixCls, "-benchmark-ranking-bar"), styles.bar),
|
|
369
|
-
style: {
|
|
370
|
-
background: barColor,
|
|
371
|
-
height: barSize,
|
|
372
|
-
transition: showAnimation ? undefined : 'none',
|
|
373
|
-
width: "".concat(percent, "%")
|
|
374
|
-
}
|
|
375
|
-
}), errorPct > 0 ? /*#__PURE__*/_jsx("div", {
|
|
376
|
-
className: styles.errorBar,
|
|
377
|
-
"data-testid": "benchmark-error-bar",
|
|
378
|
-
style: {
|
|
379
|
-
left: "".concat(errorLeft, "%"),
|
|
380
|
-
width: "".concat(errorWidth, "%")
|
|
381
|
-
}
|
|
382
|
-
}) : null]
|
|
383
|
-
})
|
|
384
|
-
}), "plot-".concat(item.key));
|
|
385
|
-
})
|
|
386
|
-
}), showXAxis ? /*#__PURE__*/_jsxs("div", {
|
|
387
|
-
className: styles.xAxis,
|
|
388
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
389
|
-
className: styles.xAxisLine
|
|
390
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
391
|
-
className: styles.xAxisTicks,
|
|
392
|
-
children: axisTicks.map(function (tick) {
|
|
393
|
-
return /*#__PURE__*/_jsx("span", {
|
|
394
|
-
className: styles.xAxisTick,
|
|
395
|
-
style: {
|
|
396
|
-
left: "".concat(toPercent(tick), "%"),
|
|
397
|
-
transform: tick === 0 ? 'translateX(0)' : tick === resolvedMaxValue ? 'translateX(-100%)' : 'translateX(-50%)'
|
|
398
|
-
},
|
|
399
|
-
children: displayFormatter(tick)
|
|
400
|
-
}, tick);
|
|
401
|
-
})
|
|
402
|
-
}), xAxisLabel ? /*#__PURE__*/_jsx("div", {
|
|
403
|
-
className: styles.xAxisLabel,
|
|
404
|
-
children: xAxisLabel
|
|
405
|
-
}) : null]
|
|
406
|
-
}) : null]
|
|
407
|
-
}), showValueLabel ? /*#__PURE__*/_jsxs(Flexbox, {
|
|
408
|
-
className: styles.scoreColumn,
|
|
409
|
-
gap: 8,
|
|
410
|
-
children: [items.map(function (item) {
|
|
411
|
-
var textColor = item.highlighted ? resolvedHighlightColor : undefined;
|
|
412
|
-
var display = formatBenchmarkAccuracyDisplay({
|
|
413
|
-
accuracyFormatter: accuracyFormatter,
|
|
414
|
-
error: item.error,
|
|
415
|
-
errorFormatter: errorFormatter,
|
|
416
|
-
showError: showError && !enableErrorBars,
|
|
417
|
-
value: item.value,
|
|
418
|
-
valueFormatter: valueFormatter
|
|
419
|
-
});
|
|
420
|
-
return renderRowTooltip(item, /*#__PURE__*/_jsx(Flexbox, {
|
|
421
|
-
align: "center",
|
|
422
|
-
className: styles.scoreRow,
|
|
423
|
-
height: rowHeight,
|
|
424
|
-
horizontal: true,
|
|
425
|
-
justify: "flex-end",
|
|
426
|
-
onClick: function onClick() {
|
|
427
|
-
return handleClick(item);
|
|
428
|
-
},
|
|
429
|
-
style: {
|
|
430
|
-
cursor: onValueChange || showTooltip ? 'pointer' : 'default'
|
|
431
|
-
},
|
|
432
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
433
|
-
className: styles.score,
|
|
434
|
-
style: textColor ? {
|
|
435
|
-
color: textColor
|
|
436
|
-
} : undefined,
|
|
437
|
-
children: [displayFormatter(item.value), display.errorText ? /*#__PURE__*/_jsxs("span", {
|
|
438
|
-
className: styles.scoreError,
|
|
439
|
-
children: ["\xB1 ", display.errorText]
|
|
440
|
-
}) : null]
|
|
441
|
-
})
|
|
442
|
-
}), "score-".concat(item.key));
|
|
443
|
-
}), showXAxis ? /*#__PURE__*/_jsx("div", {
|
|
444
|
-
className: styles.axisLabelSpacer,
|
|
445
|
-
style: {
|
|
446
|
-
minHeight: xAxisLabel ? 44 : 28
|
|
447
|
-
}
|
|
448
|
-
}) : null]
|
|
449
|
-
}) : null, !data.length && /*#__PURE__*/_jsx(NoData, {
|
|
450
|
-
noDataText: noDataText
|
|
451
|
-
})]
|
|
452
|
-
}));
|
|
453
|
-
});
|
|
454
|
-
BenchmarkRankingChart.displayName = 'BenchmarkRankingChart';
|
|
455
|
-
export default BenchmarkRankingChart;
|