@lobehub/charts 5.3.1 → 5.5.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.
Files changed (37) hide show
  1. package/es/AccuracyBarChart/index.mdx +52 -0
  2. package/es/AreaChart/index.mdx +49 -0
  3. package/es/BarChart/index.mdx +73 -0
  4. package/es/BarList/index.mdx +34 -0
  5. package/es/BenchmarkColumnChart/index.d.ts +140 -0
  6. package/es/BenchmarkColumnChart/index.js +686 -0
  7. package/es/BenchmarkColumnChart/index.mdx +66 -0
  8. package/es/BenchmarkColumnChart/styles.d.ts +16 -0
  9. package/es/BenchmarkColumnChart/styles.js +23 -0
  10. package/es/BenchmarkRankingChart/index.d.ts +87 -0
  11. package/es/BenchmarkRankingChart/index.js +448 -0
  12. package/es/BenchmarkRankingChart/index.mdx +59 -0
  13. package/es/BenchmarkRankingChart/styles.d.ts +33 -0
  14. package/es/BenchmarkRankingChart/styles.js +41 -0
  15. package/es/ComposedChart/index.mdx +43 -0
  16. package/es/DataBars/index.mdx +36 -0
  17. package/es/DonutChart/index.mdx +48 -0
  18. package/es/FunnelChart/index.mdx +21 -0
  19. package/es/Heatmaps/index.mdx +70 -0
  20. package/es/Legend/index.mdx +13 -0
  21. package/es/LineChart/index.mdx +49 -0
  22. package/es/RadarChart/index.mdx +52 -0
  23. package/es/ScatterChart/index.mdx +49 -0
  24. package/es/SparkChart/index.mdx +29 -0
  25. package/es/Tracker/index.mdx +41 -0
  26. package/es/common/ChartTooltip/ChartTooltipFrame.js +1 -1
  27. package/es/common/ChartTooltip/ChartTooltipRow.js +3 -1
  28. package/es/common/ChartTooltip/index.js +2 -0
  29. package/es/common/benchmark/index.d.ts +2 -0
  30. package/es/common/benchmark/index.js +1 -0
  31. package/es/common/benchmark/types.d.ts +117 -0
  32. package/es/common/benchmark/types.js +1 -0
  33. package/es/common/benchmark/utils.d.ts +56 -0
  34. package/es/common/benchmark/utils.js +159 -0
  35. package/es/index.d.ts +3 -0
  36. package/es/index.js +2 -0
  37. package/package.json +1 -2
@@ -0,0 +1,52 @@
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> */}
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: AreaChart
3
+ description: An area chart displays quantitative data graphically. It is based on the line chart but the area between x-axis and line is emphasized with color.
4
+ category: Charts
5
+ order: 2
6
+ ---
7
+
8
+ import DemoIndex from './demos/index.tsx?demo';
9
+ import DemoExample from './demos/example.tsx?demo';
10
+ import DemoClickEvent from './demos/clickEvent.tsx?demo';
11
+ import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
12
+ import DemoCustomColors from './demos/customColors.tsx?demo';
13
+ import DemoAxis from './demos/axis.tsx?demo';
14
+
15
+ <Demo of={DemoIndex} layout="bare" />
16
+
17
+ ## Usage example
18
+
19
+ The example below shows a composition combining an `AreaChart` with text elements.
20
+
21
+ <Demo of={DemoExample} />
22
+
23
+ ## Usage example with click event
24
+
25
+ The example below shows an interacive chart using the `onValueChange` prop.
26
+
27
+ <Demo of={DemoClickEvent} />
28
+
29
+ ## Usage example with custom tooltip
30
+
31
+ The example below shows a custom tooltip using `customTooltip` prop.
32
+
33
+ <Demo of={DemoCustomTooltip} />
34
+
35
+ ## Usage example with a custom colors
36
+
37
+ The example below shows a chart with custom `colors`.
38
+
39
+ <Demo of={DemoCustomColors} />
40
+
41
+ ## Usage example with x-axis and y-axis labels
42
+
43
+ The example below shows added axis labels using `xAxisLabel` and `yAxisLabel` prop.
44
+
45
+ <Demo of={DemoAxis} />
46
+
47
+ ## API
48
+
49
+ <Api name="AreaChart" />
@@ -0,0 +1,73 @@
1
+ ---
2
+ title: BarChart
3
+ description: Bar charts compare numerical values and use the length of each bar to represent the value of each variable.
4
+ category: Charts
5
+ order: 0
6
+ ---
7
+
8
+ import DemoIndex from './demos/index.tsx?demo';
9
+ import DemoExample from './demos/example.tsx?demo';
10
+ import DemoXAxisLabelFormatter from './demos/xAxisLabelFormatter.tsx?demo';
11
+ import DemoGroups from './demos/groups.tsx?demo';
12
+ import DemoClickEvent from './demos/clickEvent.tsx?demo';
13
+ import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
14
+ import DemoCustomColors from './demos/customColors.tsx?demo';
15
+ import DemoAxis from './demos/axis.tsx?demo';
16
+ import DemoNoData from './demos/noData.tsx?demo';
17
+ import DemoLoading from './demos/loading.tsx?demo';
18
+
19
+ <Demo of={DemoIndex} layout="bare" />
20
+
21
+ ## Usage example
22
+
23
+ The example below shows a chart composition combining a `BarChart` with text elements.
24
+
25
+ <Demo of={DemoExample} />
26
+
27
+ ## Usage example with custom X axis labels
28
+
29
+ The example below shows an interacive chart using the `xAxisLabelFormatter` prop.
30
+
31
+ <Demo of={DemoXAxisLabelFormatter} />
32
+
33
+ ## Usage example with groups
34
+
35
+ The example below shows a chart with a group composition.
36
+
37
+ <Demo of={DemoGroups} />
38
+
39
+ ## Usage example with click event
40
+
41
+ The example below shows an interacive chart using the `onValueChange` prop.
42
+
43
+ <Demo of={DemoClickEvent} />
44
+
45
+ ## Usage example with custom tooltip
46
+
47
+ The example below shows a custom tooltip using `customTooltip` prop.
48
+
49
+ <Demo of={DemoCustomTooltip} />
50
+
51
+ ## Usage example with a custom colors
52
+
53
+ The example below shows a chart with custom `colors`.
54
+
55
+ <Demo of={DemoCustomColors} />
56
+
57
+ ## Usage example with x-axis and y-axis labels
58
+
59
+ The example below shows added axis labels using `xAxisLabel` and `yAxisLabel` props.
60
+
61
+ <Demo of={DemoAxis} />
62
+
63
+ ## No Data
64
+
65
+ <Demo of={DemoNoData} />
66
+
67
+ ## Loading
68
+
69
+ <Demo of={DemoLoading} />
70
+
71
+ ## API
72
+
73
+ <Api name="BarChart" />
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: BarList
3
+ description: Horizontal bars with a customizable label inside.
4
+ category: Visualizations
5
+ ---
6
+
7
+ import DemoIndex from './demos/index.tsx?demo';
8
+ import DemoExample from './demos/example.tsx?demo';
9
+ import DemoClickEvent from './demos/clickEvent.tsx?demo';
10
+ import DemoCustomColors from './demos/customColors.tsx?demo';
11
+
12
+ <Demo of={DemoIndex} layout="bare" />
13
+
14
+ ## Usage example
15
+
16
+ You can also pass an `href` into the data, then your datapoint gets rendered as a clickable link with `target="_blank"`.
17
+
18
+ <Demo of={DemoExample} />
19
+
20
+ ## Usage example with click event
21
+
22
+ The example below shows an interacive chart using the `onValueChange` prop.
23
+
24
+ <Demo of={DemoClickEvent} />
25
+
26
+ ## Usage example with a custom colors
27
+
28
+ The example below shows a chart with custom `colors`.
29
+
30
+ <Demo of={DemoCustomColors} />
31
+
32
+ ## API
33
+
34
+ <Api name="BarList" />
@@ -0,0 +1,140 @@
1
+ import { ReactNode } from 'react';
2
+ import { type BenchmarkBaseProps, type NormalizedBenchmarkItem } from "../common/benchmark";
3
+ export interface BenchmarkColumnChartProps extends BenchmarkBaseProps {
4
+ animationDuration?: number;
5
+ /**
6
+ * Auto-compute Y min
7
+ * @default false
8
+ */
9
+ autoMinValue?: boolean;
10
+ /**
11
+ * Gap between bar categories
12
+ * @default '10%'
13
+ */
14
+ barCategoryGap?: string | number;
15
+ /**
16
+ * Display name for the bar series in legend / tooltip.
17
+ * Pass `false` or `''` to hide from the legend (tooltip still uses a fallback).
18
+ * @default 'Score'
19
+ */
20
+ barName?: string | false;
21
+ /**
22
+ * Rounded top corners radius
23
+ * @default 0
24
+ */
25
+ barRadius?: number;
26
+ /**
27
+ * Fallback colors when items omit per-item color
28
+ */
29
+ colors?: string[];
30
+ /**
31
+ * Rotate X-axis labels
32
+ * @default -66
33
+ */
34
+ labelAngle?: number;
35
+ /**
36
+ * X-axis label font size
37
+ * @default 11
38
+ */
39
+ labelFontSize?: number;
40
+ /**
41
+ * Height reserved for icons + X-axis labels (via XAxis height)
42
+ * @default auto from label length / angle
43
+ */
44
+ labelHeight?: number;
45
+ /**
46
+ * Color of the overlay line
47
+ * @default theme.gold
48
+ */
49
+ lineColor?: string;
50
+ /**
51
+ * Secondary line-series field
52
+ * @default 'line'
53
+ */
54
+ lineKey?: string;
55
+ /**
56
+ * Display name for the line series in legend / tooltip.
57
+ * Pass `false` or `''` to hide from the legend (tooltip still uses a fallback).
58
+ * @default 'Overall'
59
+ */
60
+ lineName?: string | false;
61
+ /**
62
+ * Override Y domain max
63
+ */
64
+ maxValue?: number;
65
+ /**
66
+ * Override Y domain min
67
+ * @default 0
68
+ */
69
+ minValue?: number;
70
+ /**
71
+ * Minimum chart width; enables horizontal scroll when container is narrower
72
+ */
73
+ minWidth?: number;
74
+ /**
75
+ * Custom rank renderer. Default is `#${rank}`.
76
+ */
77
+ renderRank?: (item: NormalizedBenchmarkItem) => ReactNode;
78
+ /**
79
+ * Show AccuracyBar-style error bars
80
+ * @default true
81
+ */
82
+ showErrorBars?: boolean;
83
+ /**
84
+ * Show dashed horizontal grid lines
85
+ * @default true
86
+ */
87
+ showGridLines?: boolean;
88
+ /**
89
+ * Show legend when a line series is present
90
+ * @default true
91
+ */
92
+ showLegend?: boolean;
93
+ /**
94
+ * Show overlay line series when data includes line values
95
+ * @default true
96
+ */
97
+ showLine?: boolean;
98
+ /**
99
+ * Show numeric labels above line points
100
+ * @default true
101
+ */
102
+ showLineLabel?: boolean;
103
+ /**
104
+ * Show rank under each column (bottom of X-axis labels)
105
+ * @default false
106
+ */
107
+ showRank?: boolean;
108
+ /**
109
+ * Show tooltip
110
+ * @default true
111
+ */
112
+ showTooltip?: boolean;
113
+ /**
114
+ * Show numeric labels on bars
115
+ * @default true
116
+ */
117
+ showValueLabel?: boolean;
118
+ /**
119
+ * Show X axis line (category labels stay visible)
120
+ * @default false
121
+ */
122
+ showXAxis?: boolean;
123
+ /**
124
+ * Show Y axis line + value ticks
125
+ * @default false
126
+ */
127
+ showYAxis?: boolean;
128
+ /**
129
+ * Annotation shown near the unranked separator.
130
+ * Pass `false` or `''` to hide.
131
+ */
132
+ unrankedLabel?: string | false;
133
+ /**
134
+ * Font size for numeric labels on bars
135
+ * @default 12
136
+ */
137
+ valueLabelFontSize?: number;
138
+ }
139
+ declare const BenchmarkColumnChart: import("react").ForwardRefExoticComponent<BenchmarkColumnChartProps & import("react").RefAttributes<HTMLDivElement>>;
140
+ export default BenchmarkColumnChart;