@acronis-platform/ui-react 0.60.0 → 0.61.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 +5 -5
- package/dist/components/ui/app-shell/app-shell.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +209 -146
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +26 -23
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +595 -180
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +98 -77
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-format.js +144 -14
- package/dist/components/ui/chart/chart-format.js.map +1 -1
- package/dist/components/ui/chart/chart.js +204 -150
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +422 -125
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +308 -202
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +85 -81
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +227 -184
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +88 -70
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +234 -80
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +210 -57
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +25 -18
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +86 -78
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +206 -142
- package/dist/components/ui/timeline/timeline.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +183 -59
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +441 -421
- package/dist/index.js.map +1 -1
- package/dist/react.js +441 -421
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +53 -3
- package/dist/src/components/ui/area-chart/index.d.ts +1 -1
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +154 -16
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
- package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +415 -0
- package/dist/src/components/ui/chart/chart.d.ts +9 -3
- package/dist/src/components/ui/chart/index.d.ts +2 -2
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +156 -7
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -20
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +2 -2
- package/dist/src/components/ui/line-chart/index.d.ts +1 -1
- package/dist/src/components/ui/line-chart/line-chart.d.ts +51 -3
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -2
- package/dist/src/components/ui/timeline/index.d.ts +1 -1
- package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
- package/dist/src/components/ui/treemap/index.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
- package/dist/src/index.d.ts +0 -1
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
- package/dist/components/ui/search-global/search-global.js +0 -60
- package/dist/components/ui/search-global/search-global.js.map +0 -1
- package/dist/src/components/ui/search-global/index.d.ts +0 -1
- package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
|
@@ -1,18 +1,88 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { ChartTooltip, ChartConfig } from '../chart';
|
|
2
|
+
import { ChartTooltip, ChartConfig, ChartTooltipContentProps, ChartAnimationProps, ChartDataLabelProps, PolarLabelPosition, TickFormatter } from '../chart';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const pieChartVariants: (props?: ({
|
|
5
5
|
shape?: "pie" | "donut" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
/** Row-per-slice datum: the `nameKey` label plus the `dataKey` value. */
|
|
8
|
+
type PieChartDatum = Record<string, string | number>;
|
|
9
|
+
/**
|
|
10
|
+
* What a slice's data label reads. `percent` is the slice's share of the sum of
|
|
11
|
+
* every slice value, to one decimal.
|
|
12
|
+
*/
|
|
13
|
+
export type PieChartLabelFormat = 'value' | 'name-value' | 'name-percent' | 'percent';
|
|
14
|
+
/** What the tooltip's value reads — the raw value, or the value and its share. */
|
|
15
|
+
export type PieChartTooltipFormat = 'value' | 'value-percent';
|
|
16
|
+
/** Per-slice overrides, keyed by the slice's `nameKey` value. */
|
|
17
|
+
export interface PieChartSliceSettings {
|
|
18
|
+
/**
|
|
19
|
+
* Fill for this slice, overriding its `config` color. Reference an existing
|
|
20
|
+
* semantic `--ui-*` token, same as `config`.
|
|
21
|
+
*/
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Drop this slice's data label while every other slice keeps its own. */
|
|
24
|
+
hideLabel?: boolean;
|
|
25
|
+
/** Label format for this slice only — overrides the chart-level `labelFormat`. */
|
|
26
|
+
labelFormat?: PieChartLabelFormat;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compose one slice's data-label text. Exported for unit tests; not part of the
|
|
30
|
+
* package's public API.
|
|
31
|
+
*
|
|
32
|
+
* A percent needs a numeric slice value *and* a non-zero total, and a value
|
|
33
|
+
* label needs a value at all — so every format degrades rather than printing
|
|
34
|
+
* `NaN%` or a dangling `"Chrome: "`. The two name-carrying formats fall back to
|
|
35
|
+
* the bare name; the value-only ones to `''`, which `resolveSliceLabel`
|
|
36
|
+
* normalizes to `null` (the one value recharts renders no `<text>` for).
|
|
37
|
+
*
|
|
38
|
+
* `labelFormatter` formats the slice's *value*, so it reaches `value` and
|
|
39
|
+
* `name-value` only. A percent is always composed by `slicePercentText` and
|
|
40
|
+
* never passes through the formatter.
|
|
41
|
+
*/
|
|
42
|
+
export declare function pieChartLabelText(options: {
|
|
43
|
+
format: PieChartLabelFormat;
|
|
44
|
+
name: string | number;
|
|
45
|
+
value: string | number | undefined;
|
|
46
|
+
total: number;
|
|
47
|
+
formatter?: TickFormatter;
|
|
48
|
+
}): string;
|
|
49
|
+
/**
|
|
50
|
+
* The row renderer behind `tooltipFormat="value-percent"` — a slice's value
|
|
51
|
+
* followed by its share. Exported for unit tests; not part of the package's
|
|
52
|
+
* public API.
|
|
53
|
+
*
|
|
54
|
+
* A `formatter` replaces the default row wholesale, so the swatch and the name
|
|
55
|
+
* are rebuilt here to match it: the shared `ChartTooltipContent` prefers a
|
|
56
|
+
* `config` entry's `icon` over the color swatch, and this has to do the same or
|
|
57
|
+
* a chart with icons would silently lose them under this preset — and the
|
|
58
|
+
* name/value `gap-4`, which has to be repeated here because a `formatter`
|
|
59
|
+
* replaces the shared row that carries it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function pieChartValuePercentRow(options: {
|
|
62
|
+
config: ChartConfig;
|
|
63
|
+
total: number;
|
|
64
|
+
}): NonNullable<ChartTooltipContentProps['formatter']>;
|
|
65
|
+
/**
|
|
66
|
+
* The configured `ChartTooltipContent` for `tooltipFormat="value-percent"`.
|
|
67
|
+
* Exported so the visual-regression story renders the very same element the
|
|
68
|
+
* component does — recharts can only open a hover tooltip statically via
|
|
69
|
+
* `defaultIndex` on a raw composition, so the preset has to be reachable from
|
|
70
|
+
* outside the component to be snapshotted at all.
|
|
71
|
+
*/
|
|
72
|
+
export declare function pieChartValuePercentTooltip(options: {
|
|
73
|
+
nameKey: string;
|
|
74
|
+
config: ChartConfig;
|
|
75
|
+
total: number;
|
|
76
|
+
}): React.ReactElement;
|
|
7
77
|
export interface PieChartCenterLabel {
|
|
8
78
|
/** Headline metric rendered large in the donut hole (e.g. a total). */
|
|
9
79
|
value?: string | number;
|
|
10
80
|
/** Caption rendered under the value. */
|
|
11
81
|
label?: string | number;
|
|
12
82
|
}
|
|
13
|
-
export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof pieChartVariants
|
|
83
|
+
export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof pieChartVariants>, ChartAnimationProps, ChartDataLabelProps {
|
|
14
84
|
/** Row-per-slice data. Each object holds the slice's `nameKey` label + its `dataKey` numeric value. */
|
|
15
|
-
data: ReadonlyArray<
|
|
85
|
+
data: ReadonlyArray<PieChartDatum>;
|
|
16
86
|
/**
|
|
17
87
|
* Per-slice map of `label` / `color`, keyed by the slice's `nameKey` value
|
|
18
88
|
* (imported from the shared `Chart` primitives). Turned into `--color-<name>`
|
|
@@ -40,15 +110,86 @@ export interface PieChartProps extends Omit<React.ComponentProps<'div'>, 'childr
|
|
|
40
110
|
outerRadius?: number;
|
|
41
111
|
/** Gap between slices, in degrees. */
|
|
42
112
|
paddingAngle?: number;
|
|
113
|
+
/** Corner radius of each slice. */
|
|
114
|
+
cornerRadius?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Angle the sweep starts at, in degrees (0 is 3 o'clock, counter-clockwise).
|
|
117
|
+
* Pair with `endAngle` for a semicircle (`180` → `0`) or an arc.
|
|
118
|
+
*
|
|
119
|
+
* A partial sweep still centres on the full plot area, so a half turn fills
|
|
120
|
+
* only half its box — give the chart a short, wide one rather than expecting
|
|
121
|
+
* the arc to grow into a square.
|
|
122
|
+
*/
|
|
123
|
+
startAngle?: number;
|
|
124
|
+
/** Angle the sweep ends at, in degrees. Defaults to a full `360` circle. */
|
|
125
|
+
endAngle?: number;
|
|
126
|
+
/**
|
|
127
|
+
* Smallest angle a non-zero slice may occupy, in degrees — keeps a tiny slice
|
|
128
|
+
* visible (and hoverable) at the cost of being drawn out of proportion.
|
|
129
|
+
*/
|
|
130
|
+
minAngle?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Per-slice overrides keyed by the slice's `nameKey` value: its `color`, and
|
|
133
|
+
* whether/how its data label reads. A name with no entry keeps the chart-level
|
|
134
|
+
* behavior.
|
|
135
|
+
*/
|
|
136
|
+
sliceSettings?: Record<string, PieChartSliceSettings>;
|
|
43
137
|
showTooltip?: boolean;
|
|
44
138
|
showLegend?: boolean;
|
|
139
|
+
/** Which edge the legend sits on. Defaults to `bottom`. */
|
|
140
|
+
legendPosition?: 'top' | 'bottom';
|
|
141
|
+
/** Plot-area margin, in px. Omit to use recharts' default (5 on every side). */
|
|
142
|
+
margin?: {
|
|
143
|
+
top?: number;
|
|
144
|
+
right?: number;
|
|
145
|
+
bottom?: number;
|
|
146
|
+
left?: number;
|
|
147
|
+
};
|
|
45
148
|
/**
|
|
46
149
|
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
47
150
|
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
48
151
|
* to customize formatting, per-slice rows, or extra fields without composing
|
|
49
|
-
* recharts yourself.
|
|
152
|
+
* recharts yourself. Takes precedence over `tooltipFormat`. Ignored when
|
|
153
|
+
* `showTooltip` is false.
|
|
50
154
|
*/
|
|
51
155
|
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
156
|
+
/**
|
|
157
|
+
* How the default tooltip reads a slice: its `value` alone (the default), or
|
|
158
|
+
* the value followed by its share of the total (`value-percent`). The preset
|
|
159
|
+
* covers the common case without hand-rolling a `tooltipContent`.
|
|
160
|
+
*
|
|
161
|
+
* The share is rendered as `NN.N%`, same as a data label's — not locale-aware.
|
|
162
|
+
* Pass your own `tooltipContent` if you need to format it.
|
|
163
|
+
*/
|
|
164
|
+
tooltipFormat?: PieChartTooltipFormat;
|
|
165
|
+
/**
|
|
166
|
+
* Position of the value labels when `showLabels` is on. Defaults to `outside`,
|
|
167
|
+
* which keeps them on the chart surface — the only placement that reliably
|
|
168
|
+
* has contrast, since slice fills are caller-supplied saturated colors. The
|
|
169
|
+
* on-arc placements are available but switch to the on-fill label token.
|
|
170
|
+
* Ignored when `labelLine` is on — a leader line only ever ends outside the arc.
|
|
171
|
+
*/
|
|
172
|
+
labelPosition?: PolarLabelPosition;
|
|
173
|
+
/**
|
|
174
|
+
* What each data label reads when `showLabels` is on — the value alone (the
|
|
175
|
+
* default), or the slice name and/or its share of the total. Overridable per
|
|
176
|
+
* slice via `sliceSettings`.
|
|
177
|
+
*
|
|
178
|
+
* `labelFormatter` formats the slice's *value*, so it reaches `value` and
|
|
179
|
+
* `name-value` only: a share is always rendered as `NN.N%` (a `.` decimal and
|
|
180
|
+
* a bare `%`, not locale-aware) and never passes through the formatter.
|
|
181
|
+
*/
|
|
182
|
+
labelFormat?: PieChartLabelFormat;
|
|
183
|
+
/**
|
|
184
|
+
* Draw a leader line from each slice to its data label, in the slice's own
|
|
185
|
+
* color. Moves the labels outside the arc (see `labelPosition`); slices whose
|
|
186
|
+
* label is hidden by `sliceSettings` get no line either.
|
|
187
|
+
*
|
|
188
|
+
* A label reaching out past the arc needs horizontal room — give the chart a
|
|
189
|
+
* box wider than it is tall, or shrink the arc (`outerRadius`/`margin`), or
|
|
190
|
+
* the outermost labels are clipped at the surface edge.
|
|
191
|
+
*/
|
|
192
|
+
labelLine?: boolean;
|
|
52
193
|
}
|
|
53
194
|
declare const PieChart: React.ForwardRefExoticComponent<Omit<PieChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
195
|
export { PieChart, pieChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RadarChart, radarChartVariants, type RadarChartProps } from './radar-chart';
|
|
1
|
+
export { RadarChart, radarChartVariants, type RadarChartProps, type RadarChartSeriesSettings, } from './radar-chart';
|
|
@@ -1,11 +1,89 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import {
|
|
2
|
+
import { AxisDomainItem } from 'recharts';
|
|
3
|
+
import { ChartTooltip, ChartConfig, ChartAnimationProps, ChartDataLabelProps, CartesianLabelPosition } from '../chart';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
declare const radarChartVariants: (props?: ({
|
|
5
6
|
gridType?: "circle" | "polygon" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/** Per-series overrides, keyed by the series' `dataKeys` entry. */
|
|
9
|
+
export interface RadarChartSeriesSettings {
|
|
10
|
+
/**
|
|
11
|
+
* Fill for this series' area, overriding its `config` color. Reference an
|
|
12
|
+
* existing semantic `--ui-*` token, same as `config`.
|
|
13
|
+
*/
|
|
14
|
+
color?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Outline color, when it should read differently from the fill (e.g. a solid
|
|
17
|
+
* outline over a barely-tinted area). Defaults to the fill.
|
|
18
|
+
*
|
|
19
|
+
* recharts derives a Radar's legend/tooltip color from its stroke first, so
|
|
20
|
+
* setting this alone also recolors that series' legend swatch and tooltip dot
|
|
21
|
+
* — set `color` too if the marker should keep following the fill.
|
|
22
|
+
*/
|
|
23
|
+
stroke?: string;
|
|
24
|
+
/** Fill opacity for this series, overriding the chart-level `fillOpacity`. */
|
|
25
|
+
fillOpacity?: number;
|
|
26
|
+
/** Outline width for this series, overriding the chart-level `strokeWidth`. */
|
|
27
|
+
strokeWidth?: number;
|
|
28
|
+
/** Per-point dots for this series, overriding the chart-level `showDots`. */
|
|
29
|
+
dot?: boolean;
|
|
30
|
+
/** Dot radius for this series, overriding the chart-level `dotRadius`. */
|
|
31
|
+
dotRadius?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Highlight this series' hovered point, overriding the chart-level
|
|
34
|
+
* `activeDot`.
|
|
35
|
+
*/
|
|
36
|
+
activeDot?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Map the `radiusAxisDomain` preset to a recharts radius-axis `domain`. Exported
|
|
40
|
+
* for unit tests; not part of the package's public API.
|
|
41
|
+
*
|
|
42
|
+
* The radius axis is what scales the web, so this is the difference between "the
|
|
43
|
+
* largest value in the data reaches the outer ring" (recharts' own behavior, and
|
|
44
|
+
* what an unset preset keeps) and "the outer ring is a known maximum" (`fixed`
|
|
45
|
+
* plus `radiusAxisDomainMax`). The two only mean something together: a `fixed`
|
|
46
|
+
* preset with no maximum falls back to the data's own top, i.e. that same
|
|
47
|
+
* default.
|
|
48
|
+
*/
|
|
49
|
+
export declare function radarRadiusAxisDomain(preset: 'auto' | 'fixed' | undefined, max: number | undefined): Readonly<[AxisDomainItem, AxisDomainItem]> | undefined;
|
|
50
|
+
/** The chart-level styling a `seriesSettings` entry overrides. */
|
|
51
|
+
export interface RadarSeriesDefaults {
|
|
52
|
+
fillOpacity: number;
|
|
53
|
+
strokeWidth: number;
|
|
54
|
+
showDots: boolean;
|
|
55
|
+
dotRadius: number;
|
|
56
|
+
activeDot: boolean | undefined;
|
|
57
|
+
}
|
|
58
|
+
/** Resolved recharts `<Radar>` styling for one series. */
|
|
59
|
+
export interface RadarSeriesStyle {
|
|
60
|
+
fill: string;
|
|
61
|
+
stroke: string;
|
|
62
|
+
fillOpacity: number;
|
|
63
|
+
strokeWidth: number;
|
|
64
|
+
dot: {
|
|
65
|
+
r: number;
|
|
66
|
+
} | false;
|
|
67
|
+
activeDot: boolean | undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Fold a series' `seriesSettings` entry over the chart-level styling. Exported
|
|
71
|
+
* for unit tests; not part of the package's public API.
|
|
72
|
+
*
|
|
73
|
+
* Every fallback is `??`, not `||`, so a deliberate falsy override survives —
|
|
74
|
+
* `fillOpacity: 0` (outline only), `strokeWidth: 0` (fill only), `dot: false`
|
|
75
|
+
* and `activeDot: false` all have to beat a truthy chart-level value. An
|
|
76
|
+
* un-overridden fill stays the `--color-<key>` custom property the shared
|
|
77
|
+
* `ChartContainer` injects from `config`, so the series a caller doesn't name
|
|
78
|
+
* keeps reading its config color.
|
|
79
|
+
*/
|
|
80
|
+
export declare function radarSeriesStyle(key: string, settings: RadarChartSeriesSettings | undefined, defaults: RadarSeriesDefaults): RadarSeriesStyle;
|
|
81
|
+
export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof radarChartVariants>, ChartAnimationProps, ChartDataLabelProps {
|
|
82
|
+
/**
|
|
83
|
+
* Row-per-axis data. Each object holds the `angleKey` label + one numeric field
|
|
84
|
+
* per series. Every plotted series needs a value in every row: recharts places a
|
|
85
|
+
* missing one at the centre, which reads as a zero rather than as a gap.
|
|
86
|
+
*/
|
|
9
87
|
data: ReadonlyArray<Record<string, string | number>>;
|
|
10
88
|
/**
|
|
11
89
|
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
@@ -18,23 +96,158 @@ export interface RadarChartProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
18
96
|
dataKeys: string[];
|
|
19
97
|
/** The categorical axis key placed around the web (e.g. `"subject"`). */
|
|
20
98
|
angleKey: string;
|
|
99
|
+
/**
|
|
100
|
+
* Per-series style overrides, keyed by a `dataKeys` entry — color, outline, and
|
|
101
|
+
* dots for one series while the rest keep the chart-level values. Keys that
|
|
102
|
+
* aren't plotted are ignored. An overridden `color` — or `stroke`, which
|
|
103
|
+
* recharts reads first — follows through to that series' legend swatch and
|
|
104
|
+
* tooltip dot.
|
|
105
|
+
*/
|
|
106
|
+
seriesSettings?: Record<string, RadarChartSeriesSettings>;
|
|
21
107
|
/** Fill opacity of each radar area. */
|
|
22
108
|
fillOpacity?: number;
|
|
23
109
|
/** Stroke width of each radar outline. */
|
|
24
110
|
strokeWidth?: number;
|
|
25
111
|
/** Render a dot at each axis point. */
|
|
26
112
|
showDots?: boolean;
|
|
113
|
+
/** Radius of the per-point dots when `showDots` is on. */
|
|
114
|
+
dotRadius?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Enlarge the hovered point's dot. On by default (recharts' behavior) — pass
|
|
117
|
+
* `false` for a chart that shouldn't react to the pointer at all.
|
|
118
|
+
*/
|
|
119
|
+
activeDot?: boolean;
|
|
27
120
|
/** Render the polar grid (the web). */
|
|
28
121
|
showGrid?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Draw the grid's spokes — the radial lines from the centre out to each
|
|
124
|
+
* category. Defaults to `true`; off leaves only the concentric rings.
|
|
125
|
+
*/
|
|
126
|
+
radialLines?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Render the categorical axis around the web (its spoke labels, tick lines,
|
|
129
|
+
* and outer line). Defaults to `true`. Turning it off keeps the axis itself —
|
|
130
|
+
* so the tooltip still names each category — and only hides its chrome.
|
|
131
|
+
*/
|
|
132
|
+
showAngleAxis?: boolean;
|
|
133
|
+
/** Place the spoke labels outside the web (default) or inside it. */
|
|
134
|
+
angleAxisOrientation?: 'inner' | 'outer';
|
|
135
|
+
/** Draw the line around the web that the spoke labels sit against. Defaults to `true`. */
|
|
136
|
+
angleAxisLine?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Shape of that line: straight-edged `polygon` (recharts' default) or a smooth
|
|
139
|
+
* `circle`. Independent of `gridType`, so pair them to keep a circular web's
|
|
140
|
+
* outline circular too.
|
|
141
|
+
*/
|
|
142
|
+
angleAxisLineType?: 'polygon' | 'circle';
|
|
143
|
+
/** Draw a tick line from the axis line to each spoke label. Defaults to `true`. */
|
|
144
|
+
angleTickLine?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Distance from the web to the spoke labels, in px (recharts' default is 8).
|
|
147
|
+
* Left alone, `showLabels` widens it so a vertex's value can't land on its own
|
|
148
|
+
* category label.
|
|
149
|
+
*/
|
|
150
|
+
angleTickSize?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Render the value scale — a radial axis of ticks from the centre outward, so
|
|
153
|
+
* an area can be read as a number and not only compared to its neighbours.
|
|
154
|
+
* Defaults to `false` (recharts draws no radius axis unless asked).
|
|
155
|
+
*
|
|
156
|
+
* `radiusAxisAngle` and `radiusAxisOrientation` only describe the drawn scale,
|
|
157
|
+
* so they need it shown. `radiusAxisDomain`, `radiusAxisReversed` and
|
|
158
|
+
* `radiusAxisTickCount` apply while it's hidden too — the first two scale the
|
|
159
|
+
* web, and the third sets how many rings the grid draws (recharts takes the
|
|
160
|
+
* grid's concentric radii from the radius axis' ticks).
|
|
161
|
+
*/
|
|
162
|
+
showRadiusAxis?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Angle the value scale is drawn at, in degrees counter-clockwise from 3
|
|
165
|
+
* o'clock (recharts' default is `0`). Point it *between* two spokes: on a
|
|
166
|
+
* spoke, the outermost tick collides with that category's own label.
|
|
167
|
+
*
|
|
168
|
+
* The ticks sit over the areas at any angle — a radar's plot area is its
|
|
169
|
+
* areas — so this trades one overlap for none of the other.
|
|
170
|
+
*/
|
|
171
|
+
radiusAxisAngle?: number;
|
|
172
|
+
/** Which side of the scale its tick labels sit on. Defaults to `right`. */
|
|
173
|
+
radiusAxisOrientation?: 'left' | 'right' | 'middle';
|
|
174
|
+
/**
|
|
175
|
+
* How the value scale is bounded — and with it the web, since the radius axis
|
|
176
|
+
* is what maps a value to a radius:
|
|
177
|
+
*
|
|
178
|
+
* - unset — recharts' own scaling: the data's largest value reaches the outer
|
|
179
|
+
* ring, so two charts of the same metric aren't comparable.
|
|
180
|
+
* - `fixed` — pin the outer ring to `radiusAxisDomainMax` (the metric's own
|
|
181
|
+
* maximum, e.g. a score out of 150), which is what makes a radar readable as
|
|
182
|
+
* an absolute profile rather than a relative one.
|
|
183
|
+
* - `auto` — fit the data at both ends; the scale need not start at 0.
|
|
184
|
+
*
|
|
185
|
+
* Takes effect whether or not the scale is shown, so a chart can be scaled to a
|
|
186
|
+
* known maximum without displaying the ticks.
|
|
187
|
+
*/
|
|
188
|
+
radiusAxisDomain?: 'auto' | 'fixed';
|
|
189
|
+
/**
|
|
190
|
+
* The value at the outer ring when `radiusAxisDomain` is `fixed`. Must be
|
|
191
|
+
* positive — a `0` or negative maximum can't bound an outward-growing scale, so
|
|
192
|
+
* it falls back to the data's own top.
|
|
193
|
+
*/
|
|
194
|
+
radiusAxisDomainMax?: number;
|
|
195
|
+
/**
|
|
196
|
+
* Desired number of ticks on the value scale (a hint, not exact). Defaults to
|
|
197
|
+
* recharts' `5`. Also sets how many rings the grid draws, whether or not the
|
|
198
|
+
* scale itself is shown.
|
|
199
|
+
*/
|
|
200
|
+
radiusAxisTickCount?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Invert the value scale — the maximum at the centre and 0 at the outer ring —
|
|
203
|
+
* for a metric where less is better (latency, error rate), so a good profile
|
|
204
|
+
* still reads as a large area.
|
|
205
|
+
*/
|
|
206
|
+
radiusAxisReversed?: boolean;
|
|
207
|
+
/** Horizontal centre of the web, in px or a percentage of the width. Defaults to `50%`. */
|
|
208
|
+
cx?: number | string;
|
|
209
|
+
/** Vertical centre of the web, in px or a percentage of the height. Defaults to `50%`. */
|
|
210
|
+
cy?: number | string;
|
|
211
|
+
/** Angle the first category sits at, in degrees. Defaults to `90` (12 o'clock). */
|
|
212
|
+
startAngle?: number;
|
|
213
|
+
/**
|
|
214
|
+
* Angle the sweep ends at, in degrees. Defaults to `-270` — a full turn
|
|
215
|
+
* clockwise from `startAngle`. Together the two rotate the web (or wrap the
|
|
216
|
+
* categories into a partial sweep).
|
|
217
|
+
*/
|
|
218
|
+
endAngle?: number;
|
|
219
|
+
/**
|
|
220
|
+
* Radius of the hole at the centre, in px or a percentage of the available
|
|
221
|
+
* radius. Defaults to `0`. Also lifts the grid and the areas off the centre,
|
|
222
|
+
* which separates the series where they all bottom out.
|
|
223
|
+
*/
|
|
224
|
+
innerRadius?: number | string;
|
|
225
|
+
/** Outer radius of the web, in px or a percentage of the available radius. Defaults to `80%`. */
|
|
226
|
+
outerRadius?: number | string;
|
|
227
|
+
/**
|
|
228
|
+
* Plot-area margin, in px. Omit it entirely to use recharts' default (5 on
|
|
229
|
+
* every side) — passing the object replaces all four, and recharts fills the
|
|
230
|
+
* sides you leave out with `0`, not with `5`. Name every side you want.
|
|
231
|
+
*/
|
|
232
|
+
margin?: {
|
|
233
|
+
top?: number;
|
|
234
|
+
right?: number;
|
|
235
|
+
bottom?: number;
|
|
236
|
+
left?: number;
|
|
237
|
+
};
|
|
29
238
|
showTooltip?: boolean;
|
|
30
239
|
showLegend?: boolean;
|
|
240
|
+
/** Which side of the chart the legend sits on. Defaults to `bottom`. */
|
|
241
|
+
legendPosition?: 'top' | 'bottom';
|
|
31
242
|
/**
|
|
32
243
|
* Replace the default tooltip. Pass a configured `ChartTooltipContent`
|
|
33
|
-
* (imported from this library) — e.g. with a `formatter` / `labelFormatter`
|
|
34
|
-
*
|
|
35
|
-
*
|
|
244
|
+
* (imported from this library) — e.g. with a `formatter` / `labelFormatter` —
|
|
245
|
+
* to customize formatting, per-series rows, or extra fields without composing
|
|
246
|
+
* recharts yourself. Ignored when `showTooltip` is false.
|
|
36
247
|
*/
|
|
37
248
|
tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];
|
|
249
|
+
/** Position of the value labels when `showLabels` is on. Defaults to `top`. */
|
|
250
|
+
labelPosition?: CartesianLabelPosition;
|
|
38
251
|
}
|
|
39
252
|
declare const RadarChart: React.ForwardRefExoticComponent<Omit<RadarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
253
|
export { RadarChart, radarChartVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RadialBarChart, type RadialBarChartProps, } from './radial-bar-chart';
|
|
1
|
+
export { RadialBarChart, type RadialBarChartProps, type RadialBarChartCenterLabel, type RadialBarChartLabelFormat, } from './radial-bar-chart';
|