@lobehub/charts 5.5.1 → 5.6.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/es/BenchmarkScatterChart/index.d.ts +145 -0
- package/es/BenchmarkScatterChart/index.js +850 -0
- package/es/BenchmarkScatterChart/index.mdx +61 -0
- package/es/BenchmarkScatterChart/styles.d.ts +25 -0
- package/es/BenchmarkScatterChart/styles.js +33 -0
- package/es/BenchmarkScatterChart/utils.d.ts +55 -0
- package/es/BenchmarkScatterChart/utils.js +353 -0
- package/es/common/benchmark/index.d.ts +1 -1
- package/es/common/benchmark/types.d.ts +6 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type BenchmarkBaseProps } from "../common/benchmark";
|
|
3
|
+
import { type ScaleType } from './utils';
|
|
4
|
+
export interface BenchmarkScatterMetric {
|
|
5
|
+
/**
|
|
6
|
+
* Axis title; falls back to `label`
|
|
7
|
+
*/
|
|
8
|
+
axisLabel?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Which direction is better on this axis (drives the Pareto frontier)
|
|
11
|
+
* @default 'lower'
|
|
12
|
+
*/
|
|
13
|
+
direction?: 'lower' | 'higher';
|
|
14
|
+
formatter?: (value: number) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Record field holding this metric
|
|
17
|
+
*/
|
|
18
|
+
key: string;
|
|
19
|
+
/**
|
|
20
|
+
* Label shown in the metric switcher and tooltip
|
|
21
|
+
*/
|
|
22
|
+
label: string;
|
|
23
|
+
max?: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
/**
|
|
26
|
+
* @default 'linear'
|
|
27
|
+
*/
|
|
28
|
+
scale?: ScaleType;
|
|
29
|
+
}
|
|
30
|
+
export interface BenchmarkScatterChartProps extends Omit<BenchmarkBaseProps, 'sortOrder'> {
|
|
31
|
+
/**
|
|
32
|
+
* Initially selected metric key when `metrics` is provided (uncontrolled)
|
|
33
|
+
*/
|
|
34
|
+
defaultMetric?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Pareto frontier line color
|
|
37
|
+
* @default theme.orange
|
|
38
|
+
*/
|
|
39
|
+
frontierColor?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @default 2
|
|
42
|
+
*/
|
|
43
|
+
frontierWidth?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Size of consumer-provided icons; should match the size the icon renders at.
|
|
46
|
+
* Icons are scaled down from this size in the legend.
|
|
47
|
+
* @default 20
|
|
48
|
+
*/
|
|
49
|
+
iconSize?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Font size for the point name label
|
|
52
|
+
* @default 12
|
|
53
|
+
*/
|
|
54
|
+
labelFontSize?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Size of the fallback shape marker when an item has no icon
|
|
57
|
+
* @default 12
|
|
58
|
+
*/
|
|
59
|
+
markerSize?: number;
|
|
60
|
+
maxX?: number;
|
|
61
|
+
maxY?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Selected metric key (controlled)
|
|
64
|
+
*/
|
|
65
|
+
metric?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Switchable X metrics (e.g. Cost / Speed). Overrides `xKey`, `xScale`,
|
|
68
|
+
* `xFormatter`, `xAxisLabel` and `xDirection` for the active metric.
|
|
69
|
+
*/
|
|
70
|
+
metrics?: BenchmarkScatterMetric[];
|
|
71
|
+
minX?: number;
|
|
72
|
+
minY?: number;
|
|
73
|
+
onMetricChange?: (metric: string) => void;
|
|
74
|
+
/**
|
|
75
|
+
* On hover, shade the region the point dominates (worse X and lower Y)
|
|
76
|
+
* and gray out the points inside it. When off, all other points are dimmed instead.
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
79
|
+
showDominatedArea?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Draw vertical error bars when records have `error`
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
showErrorBars?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Connect non-dominated points with a Pareto frontier line
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
showFrontier?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
showGridLines?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Show name labels next to points (placed automatically to avoid overlap)
|
|
96
|
+
* @default true
|
|
97
|
+
*/
|
|
98
|
+
showLabels?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
showLegend?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* @default true
|
|
105
|
+
*/
|
|
106
|
+
showTooltip?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Show `y · x` values under each point label
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
showValueLabel?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
showXAxis?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* @default true
|
|
118
|
+
*/
|
|
119
|
+
showYAxis?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Font size for the `y · x` value line
|
|
122
|
+
* @default 11
|
|
123
|
+
*/
|
|
124
|
+
valueLabelFontSize?: number;
|
|
125
|
+
xAxisLabel?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Which direction is better on X (drives the Pareto frontier)
|
|
128
|
+
* @default 'lower'
|
|
129
|
+
*/
|
|
130
|
+
xDirection?: 'lower' | 'higher';
|
|
131
|
+
xFormatter?: (value: number) => string;
|
|
132
|
+
/**
|
|
133
|
+
* Record field used for the X axis
|
|
134
|
+
* @default 'x'
|
|
135
|
+
*/
|
|
136
|
+
xKey?: string;
|
|
137
|
+
/**
|
|
138
|
+
* X axis scale
|
|
139
|
+
* @default 'linear'
|
|
140
|
+
*/
|
|
141
|
+
xScale?: ScaleType;
|
|
142
|
+
yAxisLabel?: string;
|
|
143
|
+
}
|
|
144
|
+
declare const BenchmarkScatterChart: import("react").ForwardRefExoticComponent<BenchmarkScatterChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
145
|
+
export default BenchmarkScatterChart;
|