@mui/x-charts-premium 9.0.4 → 9.2.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/BarChartPremium/BarChartPremium.d.mts +4 -1
- package/BarChartPremium/BarChartPremium.d.ts +4 -1
- package/BarChartPremium/BarChartPremium.js +23 -1191
- package/BarChartPremium/BarChartPremium.mjs +24 -1192
- package/BarChartPremium/BarPlotPremium.d.mts +37 -0
- package/BarChartPremium/BarPlotPremium.d.ts +37 -0
- package/BarChartPremium/BarPlotPremium.js +78 -0
- package/BarChartPremium/BarPlotPremium.mjs +72 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +2 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.mjs +2 -0
- package/BarChartPremium/RangeBar/useUtilityClasses.d.mts +1 -1
- package/BarChartPremium/RangeBar/useUtilityClasses.d.ts +1 -1
- package/BarChartPremium/index.d.mts +1 -0
- package/BarChartPremium/index.d.ts +1 -0
- package/BarChartPremium/index.js +12 -0
- package/BarChartPremium/index.mjs +1 -0
- package/BarChartPremium/useBarChartPremiumProps.d.mts +2 -1
- package/BarChartPremium/useBarChartPremiumProps.d.ts +2 -1
- package/BarChartPremium/useBarChartPremiumProps.js +39 -5
- package/BarChartPremium/useBarChartPremiumProps.mjs +39 -5
- package/BarChartPremium/webgl/BarWebGLPlot.d.mts +10 -0
- package/BarChartPremium/webgl/BarWebGLPlot.d.ts +10 -0
- package/BarChartPremium/webgl/BarWebGLPlot.js +81 -0
- package/BarChartPremium/webgl/BarWebGLPlot.mjs +75 -0
- package/BarChartPremium/webgl/BarWebGLProgram.d.mts +19 -0
- package/BarChartPremium/webgl/BarWebGLProgram.d.ts +19 -0
- package/BarChartPremium/webgl/BarWebGLProgram.js +107 -0
- package/BarChartPremium/webgl/BarWebGLProgram.mjs +100 -0
- package/BarChartPremium/webgl/shaders.d.mts +2 -0
- package/BarChartPremium/webgl/shaders.d.ts +2 -0
- package/BarChartPremium/webgl/shaders.js +69 -0
- package/BarChartPremium/webgl/shaders.mjs +63 -0
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +10 -0
- package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +10 -0
- package/BarChartPremium/webgl/useBarWebGLPlotData.js +160 -0
- package/BarChartPremium/webgl/useBarWebGLPlotData.mjs +154 -0
- package/CHANGELOG.md +236 -0
- package/CandlestickChart/CandlestickChart.d.mts +2 -2
- package/CandlestickChart/CandlestickChart.d.ts +2 -2
- package/CandlestickChart/CandlestickChart.js +2 -1183
- package/CandlestickChart/CandlestickChart.mjs +2 -1183
- package/CandlestickChart/CandlestickWebGLProgram.d.mts +6 -11
- package/CandlestickChart/CandlestickWebGLProgram.d.ts +6 -11
- package/CandlestickChart/CandlestickWebGLProgram.js +136 -121
- package/CandlestickChart/CandlestickWebGLProgram.mjs +137 -122
- package/CandlestickChart/useCandlestickPlotData.d.mts +2 -2
- package/CandlestickChart/useCandlestickPlotData.d.ts +2 -2
- package/CandlestickChart/useCandlestickPlotData.js +121 -61
- package/CandlestickChart/useCandlestickPlotData.mjs +122 -61
- package/ChartsAxisHighlightValue/index.d.mts +1 -0
- package/ChartsAxisHighlightValue/index.d.ts +1 -0
- package/ChartsAxisHighlightValue/index.js +16 -0
- package/ChartsAxisHighlightValue/index.mjs +2 -0
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsRadialAxisHighlight/index.d.mts +1 -0
- package/ChartsRadialAxisHighlight/index.d.ts +1 -0
- package/ChartsRadialAxisHighlight/index.js +16 -0
- package/ChartsRadialAxisHighlight/index.mjs +2 -0
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +9 -3
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +9 -3
- package/HeatmapPremium/HeatmapPremium.js +2 -155
- package/HeatmapPremium/HeatmapPremium.mjs +2 -155
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.js +19 -112
- package/HeatmapPremium/webgl/HeatmapWebGLPlot.mjs +19 -111
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.d.mts +24 -0
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.d.ts +24 -0
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +132 -0
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +125 -0
- package/HeatmapPremium/webgl/useHeatmapPlotData.d.mts +3 -3
- package/HeatmapPremium/webgl/useHeatmapPlotData.d.ts +3 -3
- package/HeatmapPremium/webgl/useHeatmapPlotData.js +78 -26
- package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +80 -26
- package/LICENSE +3 -1
- package/RadialBarChart/RadialBarChart.d.mts +67 -0
- package/RadialBarChart/RadialBarChart.d.ts +67 -0
- package/RadialBarChart/RadialBarChart.js +311 -0
- package/RadialBarChart/RadialBarChart.mjs +305 -0
- package/RadialBarChart/RadialBarChart.plugins.d.mts +4 -0
- package/RadialBarChart/RadialBarChart.plugins.d.ts +4 -0
- package/RadialBarChart/RadialBarChart.plugins.js +9 -0
- package/RadialBarChart/RadialBarChart.plugins.mjs +3 -0
- package/RadialBarChart/RadialBarElement.d.mts +16 -0
- package/RadialBarChart/RadialBarElement.d.ts +16 -0
- package/RadialBarChart/RadialBarElement.js +68 -0
- package/RadialBarChart/RadialBarElement.mjs +62 -0
- package/RadialBarChart/RadialBarPlot.d.mts +21 -0
- package/RadialBarChart/RadialBarPlot.d.ts +21 -0
- package/RadialBarChart/RadialBarPlot.js +85 -0
- package/RadialBarChart/RadialBarPlot.mjs +79 -0
- package/RadialBarChart/index.d.mts +3 -0
- package/RadialBarChart/index.d.ts +3 -0
- package/RadialBarChart/index.js +39 -0
- package/RadialBarChart/index.mjs +3 -0
- package/RadialBarChart/radialBarClasses.d.mts +15 -0
- package/RadialBarChart/radialBarClasses.d.ts +15 -0
- package/RadialBarChart/radialBarClasses.js +26 -0
- package/RadialBarChart/radialBarClasses.mjs +18 -0
- package/RadialBarChart/seriesConfig/axisTooltipGetter.js +5 -2
- package/RadialBarChart/seriesConfig/axisTooltipGetter.mjs +5 -2
- package/RadialBarChart/seriesConfig/getItemAtPosition.d.mts +6 -0
- package/RadialBarChart/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/RadialBarChart/seriesConfig/getItemAtPosition.js +69 -0
- package/RadialBarChart/seriesConfig/getItemAtPosition.mjs +63 -0
- package/RadialBarChart/seriesConfig/index.js +2 -1
- package/RadialBarChart/seriesConfig/index.mjs +2 -1
- package/RadialBarChart/seriesConfig/seriesProcessor.js +4 -0
- package/RadialBarChart/seriesConfig/seriesProcessor.mjs +4 -0
- package/RadialBarChart/useRadialBarChartProps.d.mts +30 -0
- package/RadialBarChart/useRadialBarChartProps.d.ts +30 -0
- package/RadialBarChart/useRadialBarChartProps.js +108 -0
- package/RadialBarChart/useRadialBarChartProps.mjs +101 -0
- package/RadialBarChart/useRadialBarPlotData.d.mts +23 -0
- package/RadialBarChart/useRadialBarPlotData.d.ts +23 -0
- package/RadialBarChart/useRadialBarPlotData.js +94 -0
- package/RadialBarChart/useRadialBarPlotData.mjs +87 -0
- package/RadialLineChart/RadialArea.js +13 -1
- package/RadialLineChart/RadialArea.mjs +13 -1
- package/RadialLineChart/RadialLine.js +13 -1
- package/RadialLineChart/RadialLine.mjs +13 -1
- package/RadialLineChart/RadialLineChart.d.mts +11 -3
- package/RadialLineChart/RadialLineChart.d.ts +11 -3
- package/RadialLineChart/RadialLineChart.js +26 -673
- package/RadialLineChart/RadialLineChart.mjs +26 -673
- package/RadialLineChart/RadialLineChart.plugins.d.mts +1 -1
- package/RadialLineChart/RadialLineChart.plugins.d.ts +1 -1
- package/RadialLineChart/RadialLineChart.plugins.js +1 -1
- package/RadialLineChart/RadialLineChart.plugins.mjs +1 -1
- package/RadialLineChart/RadialLineHighlightElement.d.mts +15 -0
- package/RadialLineChart/RadialLineHighlightElement.d.ts +15 -0
- package/RadialLineChart/RadialLineHighlightElement.js +46 -0
- package/RadialLineChart/RadialLineHighlightElement.mjs +39 -0
- package/RadialLineChart/RadialLineHighlightPlot.d.mts +23 -0
- package/RadialLineChart/RadialLineHighlightPlot.d.ts +23 -0
- package/RadialLineChart/RadialLineHighlightPlot.js +92 -0
- package/RadialLineChart/RadialLineHighlightPlot.mjs +86 -0
- package/RadialLineChart/RadialMarkPlot.js +17 -2
- package/RadialLineChart/RadialMarkPlot.mjs +17 -2
- package/RadialLineChart/index.d.mts +3 -1
- package/RadialLineChart/index.d.ts +3 -1
- package/RadialLineChart/index.js +22 -0
- package/RadialLineChart/index.mjs +3 -1
- package/RadialLineChart/radialLineClasses.d.mts +3 -1
- package/RadialLineChart/radialLineClasses.d.ts +3 -1
- package/RadialLineChart/radialLineClasses.js +2 -1
- package/RadialLineChart/radialLineClasses.mjs +2 -1
- package/RadialLineChart/seriesConfig/getItemAtPosition.d.mts +6 -0
- package/RadialLineChart/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/RadialLineChart/seriesConfig/getItemAtPosition.js +353 -0
- package/RadialLineChart/seriesConfig/getItemAtPosition.mjs +348 -0
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.js +2 -1
- package/RadialLineChart/seriesConfig/getSeriesWithDefaultValues.mjs +2 -1
- package/RadialLineChart/seriesConfig/index.js +2 -1
- package/RadialLineChart/seriesConfig/index.mjs +2 -1
- package/RadialLineChart/seriesConfig/seriesProcessor.js +4 -0
- package/RadialLineChart/seriesConfig/seriesProcessor.mjs +4 -0
- package/RadialLineChart/useRadialLineChartProps.d.mts +2 -0
- package/RadialLineChart/useRadialLineChartProps.d.ts +2 -0
- package/RadialLineChart/useRadialLineChartProps.js +16 -8
- package/RadialLineChart/useRadialLineChartProps.mjs +16 -8
- package/RadialLineChart/useRadialLinePlotData.js +2 -1
- package/RadialLineChart/useRadialLinePlotData.mjs +3 -2
- package/ScatterChartPremium/ScatterChartPremium.d.mts +25 -0
- package/ScatterChartPremium/ScatterChartPremium.d.ts +25 -0
- package/ScatterChartPremium/ScatterChartPremium.js +507 -0
- package/ScatterChartPremium/ScatterChartPremium.mjs +501 -0
- package/ScatterChartPremium/ScatterChartPremium.plugins.d.mts +3 -0
- package/ScatterChartPremium/ScatterChartPremium.plugins.d.ts +3 -0
- package/ScatterChartPremium/ScatterChartPremium.plugins.js +8 -0
- package/ScatterChartPremium/ScatterChartPremium.plugins.mjs +2 -0
- package/ScatterChartPremium/ScatterPlotPremium.d.mts +14 -0
- package/ScatterChartPremium/ScatterPlotPremium.d.ts +14 -0
- package/ScatterChartPremium/ScatterPlotPremium.js +28 -0
- package/ScatterChartPremium/ScatterPlotPremium.mjs +21 -0
- package/ScatterChartPremium/index.d.mts +3 -0
- package/ScatterChartPremium/index.d.ts +3 -0
- package/ScatterChartPremium/index.js +26 -0
- package/ScatterChartPremium/index.mjs +3 -0
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.mts +4 -0
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.d.ts +4 -0
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.js +70 -0
- package/ScatterChartPremium/webgl/ScatterWebGLPlot.mjs +65 -0
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +18 -0
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +18 -0
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +129 -0
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +122 -0
- package/ScatterChartPremium/webgl/shaders.d.mts +2 -0
- package/ScatterChartPremium/webgl/shaders.d.ts +2 -0
- package/ScatterChartPremium/webgl/shaders.js +57 -0
- package/ScatterChartPremium/webgl/shaders.mjs +51 -0
- package/ScatterChartPremium/webgl/useScatterWebGLPlotData.d.mts +7 -0
- package/ScatterChartPremium/webgl/useScatterWebGLPlotData.d.ts +7 -0
- package/ScatterChartPremium/webgl/useScatterWebGLPlotData.js +140 -0
- package/ScatterChartPremium/webgl/useScatterWebGLPlotData.mjs +134 -0
- package/index.d.mts +3 -1
- package/index.d.ts +3 -1
- package/index.js +25 -1
- package/index.mjs +4 -2
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +13 -0
- package/internals/index.mjs +1 -0
- package/models/seriesType/radialLine.d.mts +7 -1
- package/models/seriesType/radialLine.d.ts +7 -1
- package/package.json +76 -6
- package/plugins/selectors/useChartCandlestickPosition.selectors.d.mts +1 -1
- package/plugins/selectors/useChartCandlestickPosition.selectors.d.ts +1 -1
- package/utils/webgl/parseColor.d.mts +2 -1
- package/utils/webgl/parseColor.d.ts +2 -1
- package/utils/webgl/parseColor.js +8 -7
- package/utils/webgl/parseColor.mjs +8 -7
- package/utils/webgl/utils.d.mts +13 -0
- package/utils/webgl/utils.d.ts +13 -0
- package/utils/webgl/utils.js +29 -0
- package/utils/webgl/utils.mjs +27 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["rotationAxis", "radiusAxis", "series", "width", "height", "margin", "colors", "dataset", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "showToolbar", "axisHighlight"];
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import useId from '@mui/utils/useId';
|
|
8
|
+
import { RADIAL_BAR_CHART_PLUGINS } from "./RadialBarChart.plugins.mjs";
|
|
9
|
+
import { DEFAULT_ROTATION_AXIS_KEY } from "../constants/index.mjs";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A helper function that extracts RadialBarChartProps from the input props
|
|
13
|
+
* and returns an object with props for the children components of RadialBarChart.
|
|
14
|
+
*
|
|
15
|
+
* @param props The input props for RadialBarChart
|
|
16
|
+
* @returns An object with props for the children components of RadialBarChart
|
|
17
|
+
*/
|
|
18
|
+
export const useRadialBarChartProps = props => {
|
|
19
|
+
const {
|
|
20
|
+
rotationAxis,
|
|
21
|
+
radiusAxis,
|
|
22
|
+
series,
|
|
23
|
+
width,
|
|
24
|
+
height,
|
|
25
|
+
margin,
|
|
26
|
+
colors,
|
|
27
|
+
dataset,
|
|
28
|
+
grid,
|
|
29
|
+
children,
|
|
30
|
+
slots,
|
|
31
|
+
slotProps,
|
|
32
|
+
skipAnimation,
|
|
33
|
+
loading,
|
|
34
|
+
axisHighlight
|
|
35
|
+
} = props,
|
|
36
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
|
+
const id = useId();
|
|
38
|
+
const clipPathId = `${id}-clip-path`;
|
|
39
|
+
const seriesWithDefault = React.useMemo(() => series.map(s => _extends({
|
|
40
|
+
type: 'radialBar'
|
|
41
|
+
}, s)), [series]);
|
|
42
|
+
const defaultRotationAxis = React.useMemo(() => {
|
|
43
|
+
return [{
|
|
44
|
+
id: DEFAULT_ROTATION_AXIS_KEY,
|
|
45
|
+
scaleType: 'band',
|
|
46
|
+
data: Array.from({
|
|
47
|
+
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
48
|
+
}, (_, index) => index)
|
|
49
|
+
}];
|
|
50
|
+
}, [series, dataset]);
|
|
51
|
+
const chartsContainerProps = _extends({}, other, {
|
|
52
|
+
series: seriesWithDefault,
|
|
53
|
+
width,
|
|
54
|
+
height,
|
|
55
|
+
margin,
|
|
56
|
+
colors,
|
|
57
|
+
dataset,
|
|
58
|
+
rotationAxis: rotationAxis ?? defaultRotationAxis,
|
|
59
|
+
radiusAxis,
|
|
60
|
+
skipAnimation,
|
|
61
|
+
plugins: RADIAL_BAR_CHART_PLUGINS
|
|
62
|
+
});
|
|
63
|
+
const isHorizontal = series.some(s => s.layout === 'horizontal');
|
|
64
|
+
const axisHighlightProps = _extends({}, isHorizontal ? {
|
|
65
|
+
radius: 'band'
|
|
66
|
+
} : {
|
|
67
|
+
rotation: 'band'
|
|
68
|
+
}, axisHighlight);
|
|
69
|
+
const gridProps = grid;
|
|
70
|
+
const clipPathGroupProps = {
|
|
71
|
+
clipPath: `url(#${clipPathId})`
|
|
72
|
+
};
|
|
73
|
+
const clipPathProps = {
|
|
74
|
+
id: clipPathId
|
|
75
|
+
};
|
|
76
|
+
const overlayProps = {
|
|
77
|
+
slots,
|
|
78
|
+
slotProps,
|
|
79
|
+
loading
|
|
80
|
+
};
|
|
81
|
+
const legendProps = {
|
|
82
|
+
slots,
|
|
83
|
+
slotProps
|
|
84
|
+
};
|
|
85
|
+
const chartsWrapperProps = {
|
|
86
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
87
|
+
legendDirection: props.slotProps?.legend?.direction,
|
|
88
|
+
hideLegend: props.hideLegend ?? false
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
chartsWrapperProps,
|
|
92
|
+
chartsContainerProps,
|
|
93
|
+
gridProps,
|
|
94
|
+
clipPathProps,
|
|
95
|
+
clipPathGroupProps,
|
|
96
|
+
overlayProps,
|
|
97
|
+
legendProps,
|
|
98
|
+
axisHighlightProps,
|
|
99
|
+
children
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SeriesId } from '@mui/x-charts/models';
|
|
2
|
+
interface ProcessedRadialBarData {
|
|
3
|
+
seriesId: SeriesId;
|
|
4
|
+
dataIndex: number;
|
|
5
|
+
color: string;
|
|
6
|
+
value: number | null;
|
|
7
|
+
hidden: boolean;
|
|
8
|
+
startAngle: number;
|
|
9
|
+
endAngle: number;
|
|
10
|
+
innerRadius: number;
|
|
11
|
+
outerRadius: number;
|
|
12
|
+
}
|
|
13
|
+
interface ProcessedRadialBarSeriesData {
|
|
14
|
+
seriesId: SeriesId;
|
|
15
|
+
data: ProcessedRadialBarData[];
|
|
16
|
+
layout: 'vertical' | 'horizontal';
|
|
17
|
+
rotationOrigin: number;
|
|
18
|
+
radiusOrigin: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function useRadialBarPlotData(): {
|
|
21
|
+
completedData: ProcessedRadialBarSeriesData[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SeriesId } from '@mui/x-charts/models';
|
|
2
|
+
interface ProcessedRadialBarData {
|
|
3
|
+
seriesId: SeriesId;
|
|
4
|
+
dataIndex: number;
|
|
5
|
+
color: string;
|
|
6
|
+
value: number | null;
|
|
7
|
+
hidden: boolean;
|
|
8
|
+
startAngle: number;
|
|
9
|
+
endAngle: number;
|
|
10
|
+
innerRadius: number;
|
|
11
|
+
outerRadius: number;
|
|
12
|
+
}
|
|
13
|
+
interface ProcessedRadialBarSeriesData {
|
|
14
|
+
seriesId: SeriesId;
|
|
15
|
+
data: ProcessedRadialBarData[];
|
|
16
|
+
layout: 'vertical' | 'horizontal';
|
|
17
|
+
rotationOrigin: number;
|
|
18
|
+
radiusOrigin: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function useRadialBarPlotData(): {
|
|
21
|
+
completedData: ProcessedRadialBarSeriesData[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useRadialBarPlotData = useRadialBarPlotData;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
10
|
+
var _internals = require("@mui/x-charts/internals");
|
|
11
|
+
function useRadialBarPlotData() {
|
|
12
|
+
const seriesData = (0, _internals.useAllSeriesOfType)('radialBar') ?? {
|
|
13
|
+
series: {},
|
|
14
|
+
stackingGroups: [],
|
|
15
|
+
seriesOrder: []
|
|
16
|
+
};
|
|
17
|
+
const {
|
|
18
|
+
rotationAxis: rotationAxes,
|
|
19
|
+
rotationAxisIds
|
|
20
|
+
} = (0, _hooks.useRotationAxes)();
|
|
21
|
+
const {
|
|
22
|
+
radiusAxis: radiusAxes,
|
|
23
|
+
radiusAxisIds
|
|
24
|
+
} = (0, _hooks.useRadiusAxes)();
|
|
25
|
+
const defaultRotationAxisId = rotationAxisIds[0];
|
|
26
|
+
const defaultRadiusAxisId = radiusAxisIds[0];
|
|
27
|
+
return React.useMemo(() => processRadialBarDataForPlot(seriesData.stackingGroups, seriesData.series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId), [seriesData.stackingGroups, seriesData.series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId]);
|
|
28
|
+
}
|
|
29
|
+
function processRadialBarDataForPlot(stackingGroups, series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId) {
|
|
30
|
+
const data = stackingGroups.flatMap(({
|
|
31
|
+
ids: seriesIds
|
|
32
|
+
}, groupIndex) => {
|
|
33
|
+
return seriesIds.map(seriesId => {
|
|
34
|
+
const seriesItem = series[seriesId];
|
|
35
|
+
const rotationAxisId = seriesItem.rotationAxisId ?? defaultRotationAxisId;
|
|
36
|
+
const radiusAxisId = seriesItem.radiusAxisId ?? defaultRadiusAxisId;
|
|
37
|
+
const layout = seriesItem.layout;
|
|
38
|
+
const verticalLayout = layout === 'vertical';
|
|
39
|
+
const rotationAxisConfig = rotationAxes[rotationAxisId];
|
|
40
|
+
const radiusAxisConfig = radiusAxes[radiusAxisId];
|
|
41
|
+
const baseAxisConfig = verticalLayout ? rotationAxisConfig : radiusAxisConfig;
|
|
42
|
+
const valueAxisConfig = verticalLayout ? radiusAxisConfig : rotationAxisConfig;
|
|
43
|
+
const reverse = valueAxisConfig.reverse ?? false;
|
|
44
|
+
const baseScale = baseAxisConfig.scale;
|
|
45
|
+
const valueScale = valueAxisConfig.scale;
|
|
46
|
+
const rotationOrigin = rotationAxisConfig.scale(0) ?? 0;
|
|
47
|
+
const radiusOrigin = radiusAxisConfig.scale(0) ?? 0;
|
|
48
|
+
const {
|
|
49
|
+
barWidth: bandSlice,
|
|
50
|
+
offset
|
|
51
|
+
} = (0, _internals.getBandSize)(baseScale.bandwidth(), stackingGroups.length, baseAxisConfig.barGapRatio);
|
|
52
|
+
const seriesDataPoints = [];
|
|
53
|
+
for (let dataIndex = 0; dataIndex < baseAxisConfig.data.length; dataIndex += 1) {
|
|
54
|
+
const seriesValue = seriesItem.data[dataIndex];
|
|
55
|
+
if (seriesValue == null) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const stackValues = seriesItem.visibleStackedData[dataIndex];
|
|
59
|
+
const stackCoords = stackValues.map(v => valueScale(v));
|
|
60
|
+
const [minValueCoord, maxValueCoord] = (0, _internals.findMinMax)(stackCoords);
|
|
61
|
+
let barSize = 0;
|
|
62
|
+
if (seriesValue !== 0 && !seriesItem.hidden) {
|
|
63
|
+
barSize = Math.max(seriesItem.minBarSize ?? 0, maxValueCoord - minValueCoord);
|
|
64
|
+
}
|
|
65
|
+
const isPositive = reverse ? seriesValue < 0 : seriesValue > 0;
|
|
66
|
+
const valueStart = isPositive ? maxValueCoord - barSize : minValueCoord;
|
|
67
|
+
const valueEnd = isPositive ? maxValueCoord : minValueCoord + barSize;
|
|
68
|
+
const baseStart = baseScale(baseAxisConfig.data[dataIndex]) + groupIndex * (bandSlice + offset);
|
|
69
|
+
const baseEnd = baseStart + bandSlice;
|
|
70
|
+
seriesDataPoints.push({
|
|
71
|
+
seriesId,
|
|
72
|
+
dataIndex,
|
|
73
|
+
hidden: seriesItem.hidden,
|
|
74
|
+
color: seriesItem.color,
|
|
75
|
+
value: seriesValue,
|
|
76
|
+
startAngle: verticalLayout ? baseStart : valueStart,
|
|
77
|
+
endAngle: verticalLayout ? baseEnd : valueEnd,
|
|
78
|
+
innerRadius: verticalLayout ? valueStart : baseStart,
|
|
79
|
+
outerRadius: verticalLayout ? valueEnd : baseEnd
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
seriesId,
|
|
84
|
+
data: seriesDataPoints,
|
|
85
|
+
layout,
|
|
86
|
+
rotationOrigin,
|
|
87
|
+
radiusOrigin
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
completedData: data
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRadiusAxes, useRotationAxes } from '@mui/x-charts/hooks';
|
|
3
|
+
import { findMinMax, getBandSize, useAllSeriesOfType } from '@mui/x-charts/internals';
|
|
4
|
+
export function useRadialBarPlotData() {
|
|
5
|
+
const seriesData = useAllSeriesOfType('radialBar') ?? {
|
|
6
|
+
series: {},
|
|
7
|
+
stackingGroups: [],
|
|
8
|
+
seriesOrder: []
|
|
9
|
+
};
|
|
10
|
+
const {
|
|
11
|
+
rotationAxis: rotationAxes,
|
|
12
|
+
rotationAxisIds
|
|
13
|
+
} = useRotationAxes();
|
|
14
|
+
const {
|
|
15
|
+
radiusAxis: radiusAxes,
|
|
16
|
+
radiusAxisIds
|
|
17
|
+
} = useRadiusAxes();
|
|
18
|
+
const defaultRotationAxisId = rotationAxisIds[0];
|
|
19
|
+
const defaultRadiusAxisId = radiusAxisIds[0];
|
|
20
|
+
return React.useMemo(() => processRadialBarDataForPlot(seriesData.stackingGroups, seriesData.series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId), [seriesData.stackingGroups, seriesData.series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId]);
|
|
21
|
+
}
|
|
22
|
+
function processRadialBarDataForPlot(stackingGroups, series, rotationAxes, radiusAxes, defaultRotationAxisId, defaultRadiusAxisId) {
|
|
23
|
+
const data = stackingGroups.flatMap(({
|
|
24
|
+
ids: seriesIds
|
|
25
|
+
}, groupIndex) => {
|
|
26
|
+
return seriesIds.map(seriesId => {
|
|
27
|
+
const seriesItem = series[seriesId];
|
|
28
|
+
const rotationAxisId = seriesItem.rotationAxisId ?? defaultRotationAxisId;
|
|
29
|
+
const radiusAxisId = seriesItem.radiusAxisId ?? defaultRadiusAxisId;
|
|
30
|
+
const layout = seriesItem.layout;
|
|
31
|
+
const verticalLayout = layout === 'vertical';
|
|
32
|
+
const rotationAxisConfig = rotationAxes[rotationAxisId];
|
|
33
|
+
const radiusAxisConfig = radiusAxes[radiusAxisId];
|
|
34
|
+
const baseAxisConfig = verticalLayout ? rotationAxisConfig : radiusAxisConfig;
|
|
35
|
+
const valueAxisConfig = verticalLayout ? radiusAxisConfig : rotationAxisConfig;
|
|
36
|
+
const reverse = valueAxisConfig.reverse ?? false;
|
|
37
|
+
const baseScale = baseAxisConfig.scale;
|
|
38
|
+
const valueScale = valueAxisConfig.scale;
|
|
39
|
+
const rotationOrigin = rotationAxisConfig.scale(0) ?? 0;
|
|
40
|
+
const radiusOrigin = radiusAxisConfig.scale(0) ?? 0;
|
|
41
|
+
const {
|
|
42
|
+
barWidth: bandSlice,
|
|
43
|
+
offset
|
|
44
|
+
} = getBandSize(baseScale.bandwidth(), stackingGroups.length, baseAxisConfig.barGapRatio);
|
|
45
|
+
const seriesDataPoints = [];
|
|
46
|
+
for (let dataIndex = 0; dataIndex < baseAxisConfig.data.length; dataIndex += 1) {
|
|
47
|
+
const seriesValue = seriesItem.data[dataIndex];
|
|
48
|
+
if (seriesValue == null) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const stackValues = seriesItem.visibleStackedData[dataIndex];
|
|
52
|
+
const stackCoords = stackValues.map(v => valueScale(v));
|
|
53
|
+
const [minValueCoord, maxValueCoord] = findMinMax(stackCoords);
|
|
54
|
+
let barSize = 0;
|
|
55
|
+
if (seriesValue !== 0 && !seriesItem.hidden) {
|
|
56
|
+
barSize = Math.max(seriesItem.minBarSize ?? 0, maxValueCoord - minValueCoord);
|
|
57
|
+
}
|
|
58
|
+
const isPositive = reverse ? seriesValue < 0 : seriesValue > 0;
|
|
59
|
+
const valueStart = isPositive ? maxValueCoord - barSize : minValueCoord;
|
|
60
|
+
const valueEnd = isPositive ? maxValueCoord : minValueCoord + barSize;
|
|
61
|
+
const baseStart = baseScale(baseAxisConfig.data[dataIndex]) + groupIndex * (bandSlice + offset);
|
|
62
|
+
const baseEnd = baseStart + bandSlice;
|
|
63
|
+
seriesDataPoints.push({
|
|
64
|
+
seriesId,
|
|
65
|
+
dataIndex,
|
|
66
|
+
hidden: seriesItem.hidden,
|
|
67
|
+
color: seriesItem.color,
|
|
68
|
+
value: seriesValue,
|
|
69
|
+
startAngle: verticalLayout ? baseStart : valueStart,
|
|
70
|
+
endAngle: verticalLayout ? baseEnd : valueEnd,
|
|
71
|
+
innerRadius: verticalLayout ? valueStart : baseStart,
|
|
72
|
+
outerRadius: verticalLayout ? valueEnd : baseEnd
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
seriesId,
|
|
77
|
+
data: seriesDataPoints,
|
|
78
|
+
layout,
|
|
79
|
+
rotationOrigin,
|
|
80
|
+
radiusOrigin
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
completedData: data
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -11,6 +11,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _hooks = require("../hooks");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
|
|
16
17
|
function RadialArea(props) {
|
|
@@ -22,12 +23,23 @@ function RadialArea(props) {
|
|
|
22
23
|
points
|
|
23
24
|
} = props,
|
|
24
25
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
26
|
+
const identifier = React.useMemo(() => ({
|
|
27
|
+
type: 'radialLine',
|
|
28
|
+
seriesId
|
|
29
|
+
}), [seriesId]);
|
|
30
|
+
const highlightState = (0, _hooks.useItemHighlightState)(identifier);
|
|
31
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
32
|
+
const isFaded = highlightState === 'faded';
|
|
25
33
|
const d = (0, _d3Shape.areaRadial)().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
|
|
34
|
+
const fadedOpacity = isFaded ? 0.3 : 1;
|
|
26
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
|
|
27
36
|
"data-series": seriesId,
|
|
37
|
+
"data-highlighted": isHighlighted || undefined,
|
|
38
|
+
"data-faded": isFaded || undefined,
|
|
28
39
|
d: d,
|
|
29
40
|
fill: color,
|
|
30
41
|
stroke: "none",
|
|
31
|
-
|
|
42
|
+
filter: isHighlighted ? 'brightness(120%)' : undefined,
|
|
43
|
+
opacity: hidden ? 0 : fadedOpacity
|
|
32
44
|
}, other));
|
|
33
45
|
}
|
|
@@ -4,6 +4,7 @@ const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { areaRadial as d3AreaRadial } from '@mui/x-charts-vendor/d3-shape';
|
|
6
6
|
import { getCurveFactory } from '@mui/x-charts/internals';
|
|
7
|
+
import { useItemHighlightState } from "../hooks/index.mjs";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
function RadialArea(props) {
|
|
9
10
|
const {
|
|
@@ -14,13 +15,24 @@ function RadialArea(props) {
|
|
|
14
15
|
points
|
|
15
16
|
} = props,
|
|
16
17
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
+
const identifier = React.useMemo(() => ({
|
|
19
|
+
type: 'radialLine',
|
|
20
|
+
seriesId
|
|
21
|
+
}), [seriesId]);
|
|
22
|
+
const highlightState = useItemHighlightState(identifier);
|
|
23
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
24
|
+
const isFaded = highlightState === 'faded';
|
|
17
25
|
const d = d3AreaRadial().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
|
|
26
|
+
const fadedOpacity = isFaded ? 0.3 : 1;
|
|
18
27
|
return /*#__PURE__*/_jsx("path", _extends({
|
|
19
28
|
"data-series": seriesId,
|
|
29
|
+
"data-highlighted": isHighlighted || undefined,
|
|
30
|
+
"data-faded": isFaded || undefined,
|
|
20
31
|
d: d,
|
|
21
32
|
fill: color,
|
|
22
33
|
stroke: "none",
|
|
23
|
-
|
|
34
|
+
filter: isHighlighted ? 'brightness(120%)' : undefined,
|
|
35
|
+
opacity: hidden ? 0 : fadedOpacity
|
|
24
36
|
}, other));
|
|
25
37
|
}
|
|
26
38
|
export { RadialArea };
|
|
@@ -11,6 +11,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _hooks = require("../hooks");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
|
|
16
17
|
function RadialLine(props) {
|
|
@@ -22,12 +23,23 @@ function RadialLine(props) {
|
|
|
22
23
|
curve
|
|
23
24
|
} = props,
|
|
24
25
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
26
|
+
const identifier = React.useMemo(() => ({
|
|
27
|
+
type: 'radialLine',
|
|
28
|
+
seriesId
|
|
29
|
+
}), [seriesId]);
|
|
30
|
+
const highlightState = (0, _hooks.useItemHighlightState)(identifier);
|
|
31
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
32
|
+
const isFaded = highlightState === 'faded';
|
|
25
33
|
const d = (0, _d3Shape.lineRadial)().angle(p => p.angle).radius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
|
|
34
|
+
const fadedOpacity = isFaded ? 0.3 : 1;
|
|
26
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
|
|
27
36
|
"data-series": seriesId,
|
|
37
|
+
"data-highlighted": isHighlighted || undefined,
|
|
38
|
+
"data-faded": isFaded || undefined,
|
|
28
39
|
d: d,
|
|
29
40
|
stroke: color,
|
|
30
41
|
fill: "none",
|
|
31
|
-
|
|
42
|
+
filter: isHighlighted ? 'brightness(120%)' : undefined,
|
|
43
|
+
opacity: hidden ? 0 : fadedOpacity
|
|
32
44
|
}, other));
|
|
33
45
|
}
|
|
@@ -4,6 +4,7 @@ const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { lineRadial as d3LineRadial } from '@mui/x-charts-vendor/d3-shape';
|
|
6
6
|
import { getCurveFactory } from '@mui/x-charts/internals';
|
|
7
|
+
import { useItemHighlightState } from "../hooks/index.mjs";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
function RadialLine(props) {
|
|
9
10
|
const {
|
|
@@ -14,13 +15,24 @@ function RadialLine(props) {
|
|
|
14
15
|
curve
|
|
15
16
|
} = props,
|
|
16
17
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
+
const identifier = React.useMemo(() => ({
|
|
19
|
+
type: 'radialLine',
|
|
20
|
+
seriesId
|
|
21
|
+
}), [seriesId]);
|
|
22
|
+
const highlightState = useItemHighlightState(identifier);
|
|
23
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
24
|
+
const isFaded = highlightState === 'faded';
|
|
17
25
|
const d = d3LineRadial().angle(p => p.angle).radius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
|
|
26
|
+
const fadedOpacity = isFaded ? 0.3 : 1;
|
|
18
27
|
return /*#__PURE__*/_jsx("path", _extends({
|
|
19
28
|
"data-series": seriesId,
|
|
29
|
+
"data-highlighted": isHighlighted || undefined,
|
|
30
|
+
"data-faded": isFaded || undefined,
|
|
20
31
|
d: d,
|
|
21
32
|
stroke: color,
|
|
22
33
|
fill: "none",
|
|
23
|
-
|
|
34
|
+
filter: isHighlighted ? 'brightness(120%)' : undefined,
|
|
35
|
+
opacity: hidden ? 0 : fadedOpacity
|
|
24
36
|
}, other));
|
|
25
37
|
}
|
|
26
38
|
export { RadialLine };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ChartsSlots, type ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { type ChartsRadialGridProps } from '@mui/x-charts/ChartsRadialGrid';
|
|
4
|
+
import { type ChartsRadialAxisHighlightProps } from '@mui/x-charts/ChartsRadialAxisHighlight';
|
|
4
5
|
import { type ChartsLegendSlots, type ChartsLegendSlotProps } from "../ChartsLegend/index.mjs";
|
|
5
6
|
import { type ChartsTooltipSlots, type ChartsTooltipSlotProps } from "../ChartsTooltip/index.mjs";
|
|
6
7
|
import { type RadialLineChartPluginSignatures } from "./RadialLineChart.plugins.mjs";
|
|
7
8
|
import { type ChartsOverlayProps, type ChartsOverlaySlots, type ChartsOverlaySlotProps } from "../ChartsOverlay/index.mjs";
|
|
8
9
|
import type { LinePlotSlots, LinePlotSlotProps, LineSeries } from "../LineChart/index.mjs";
|
|
9
10
|
import { type ChartsToolbarSlots, type ChartsToolbarSlotProps } from "../Toolbar/index.mjs";
|
|
11
|
+
import { type RadialLineHighlightPlotSlots, type RadialLineHighlightPlotSlotProps } from "./RadialLineHighlightPlot.mjs";
|
|
10
12
|
import { type ChartsRadialDataProviderPremiumProps } from "../ChartsRadialDataProviderPremium/index.mjs";
|
|
11
|
-
export interface RadialLineChartSlots extends LinePlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
12
|
-
export interface RadialLineChartSlotProps extends LinePlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
13
|
+
export interface RadialLineChartSlots extends LinePlotSlots, RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
14
|
+
export interface RadialLineChartSlotProps extends LinePlotSlotProps, RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
13
15
|
export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremiumProps<'radialLine', RadialLineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
14
16
|
/**
|
|
15
17
|
* The series to display in the line chart.
|
|
@@ -17,9 +19,15 @@ export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremi
|
|
|
17
19
|
*/
|
|
18
20
|
series: Readonly<LineSeries[]>;
|
|
19
21
|
/**
|
|
20
|
-
* Option to display a
|
|
22
|
+
* Option to display a radial grid in the background.
|
|
21
23
|
*/
|
|
22
24
|
grid?: Pick<ChartsRadialGridProps, 'radius' | 'rotation'>;
|
|
25
|
+
/**
|
|
26
|
+
* The configuration of axes highlight.
|
|
27
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
28
|
+
* @default { rotation: 'line' }
|
|
29
|
+
*/
|
|
30
|
+
axisHighlight?: ChartsRadialAxisHighlightProps;
|
|
23
31
|
/**
|
|
24
32
|
* If `true`, the legend is not rendered.
|
|
25
33
|
*/
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ChartsSlots, type ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { type ChartsRadialGridProps } from '@mui/x-charts/ChartsRadialGrid';
|
|
4
|
+
import { type ChartsRadialAxisHighlightProps } from '@mui/x-charts/ChartsRadialAxisHighlight';
|
|
4
5
|
import { type ChartsLegendSlots, type ChartsLegendSlotProps } from "../ChartsLegend/index.js";
|
|
5
6
|
import { type ChartsTooltipSlots, type ChartsTooltipSlotProps } from "../ChartsTooltip/index.js";
|
|
6
7
|
import { type RadialLineChartPluginSignatures } from "./RadialLineChart.plugins.js";
|
|
7
8
|
import { type ChartsOverlayProps, type ChartsOverlaySlots, type ChartsOverlaySlotProps } from "../ChartsOverlay/index.js";
|
|
8
9
|
import type { LinePlotSlots, LinePlotSlotProps, LineSeries } from "../LineChart/index.js";
|
|
9
10
|
import { type ChartsToolbarSlots, type ChartsToolbarSlotProps } from "../Toolbar/index.js";
|
|
11
|
+
import { type RadialLineHighlightPlotSlots, type RadialLineHighlightPlotSlotProps } from "./RadialLineHighlightPlot.js";
|
|
10
12
|
import { type ChartsRadialDataProviderPremiumProps } from "../ChartsRadialDataProviderPremium/index.js";
|
|
11
|
-
export interface RadialLineChartSlots extends LinePlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
12
|
-
export interface RadialLineChartSlotProps extends LinePlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
13
|
+
export interface RadialLineChartSlots extends LinePlotSlots, RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
14
|
+
export interface RadialLineChartSlotProps extends LinePlotSlotProps, RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
13
15
|
export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremiumProps<'radialLine', RadialLineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
14
16
|
/**
|
|
15
17
|
* The series to display in the line chart.
|
|
@@ -17,9 +19,15 @@ export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremi
|
|
|
17
19
|
*/
|
|
18
20
|
series: Readonly<LineSeries[]>;
|
|
19
21
|
/**
|
|
20
|
-
* Option to display a
|
|
22
|
+
* Option to display a radial grid in the background.
|
|
21
23
|
*/
|
|
22
24
|
grid?: Pick<ChartsRadialGridProps, 'radius' | 'rotation'>;
|
|
25
|
+
/**
|
|
26
|
+
* The configuration of axes highlight.
|
|
27
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
28
|
+
* @default { rotation: 'line' }
|
|
29
|
+
*/
|
|
30
|
+
axisHighlight?: ChartsRadialAxisHighlightProps;
|
|
23
31
|
/**
|
|
24
32
|
* If `true`, the legend is not rendered.
|
|
25
33
|
*/
|