@mui/x-charts 8.8.0 → 8.9.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/BarChart/BarChart.d.ts +3 -2
- package/BarChart/BarChart.js +95 -2
- package/BarChart/BarClipPath.d.ts +17 -12
- package/BarChart/BarClipPath.js +70 -57
- package/BarChart/BarPlot.js +4 -0
- package/BarChart/barClasses.d.ts +1 -1
- package/BarChart/seriesConfig/extremums.js +2 -3
- package/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/BarChart/useBarChartProps.d.ts +1 -1
- package/BarChart/useBarPlotData.js +32 -5
- package/CHANGELOG.md +225 -24
- package/ChartContainer/ChartContainer.js +141 -0
- package/ChartsLabel/ChartsLabelMark.d.ts +2 -1
- package/ChartsLabel/index.d.ts +1 -0
- package/ChartsLabel/index.js +18 -0
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.d.ts +13 -4
- package/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.js +33 -7
- package/LineChart/LineChart.d.ts +3 -2
- package/LineChart/LineChart.js +95 -2
- package/LineChart/seriesConfig/extremums.js +2 -3
- package/LineChart/useLineChartProps.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +3 -0
- package/PieChart/PieArcPlot.js +3 -0
- package/PieChart/PieChart.d.ts +3 -2
- package/PieChart/PieChart.js +2 -2
- package/PieChart/pieClasses.d.ts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
- package/RadarChart/RadarChart.d.ts +3 -2
- package/RadarChart/RadarChart.js +24 -3
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -2
- package/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +38 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- package/RadarChart/index.d.ts +1 -1
- package/RadarChart/useRadarChartProps.d.ts +4 -1
- package/RadarChart/useRadarChartProps.js +15 -3
- package/ScatterChart/ScatterChart.d.ts +3 -2
- package/ScatterChart/ScatterChart.js +95 -2
- package/ScatterChart/seriesConfig/extremums.js +50 -23
- package/ScatterChart/useScatterChartProps.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +93 -0
- package/esm/BarChart/BarChart.d.ts +3 -2
- package/esm/BarChart/BarChart.js +95 -2
- package/esm/BarChart/BarClipPath.d.ts +17 -12
- package/esm/BarChart/BarClipPath.js +69 -55
- package/esm/BarChart/BarPlot.js +4 -0
- package/esm/BarChart/barClasses.d.ts +1 -1
- package/esm/BarChart/seriesConfig/extremums.js +2 -3
- package/esm/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/esm/BarChart/useBarChartProps.d.ts +1 -1
- package/esm/BarChart/useBarPlotData.js +32 -5
- package/esm/ChartContainer/ChartContainer.js +141 -0
- package/esm/ChartsLabel/ChartsLabelMark.d.ts +2 -1
- package/esm/ChartsLabel/index.d.ts +1 -0
- package/esm/ChartsLabel/index.js +1 -0
- package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.d.ts +13 -4
- package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.js +31 -6
- package/esm/LineChart/LineChart.d.ts +3 -2
- package/esm/LineChart/LineChart.js +95 -2
- package/esm/LineChart/seriesConfig/extremums.js +2 -3
- package/esm/LineChart/useLineChartProps.d.ts +1 -1
- package/esm/PieChart/PieArcLabelPlot.js +3 -0
- package/esm/PieChart/PieArcPlot.js +3 -0
- package/esm/PieChart/PieChart.d.ts +3 -2
- package/esm/PieChart/PieChart.js +2 -2
- package/esm/PieChart/pieClasses.d.ts +1 -1
- package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
- package/esm/RadarChart/RadarChart.d.ts +3 -2
- package/esm/RadarChart/RadarChart.js +24 -3
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -2
- package/esm/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
- package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +32 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- package/esm/RadarChart/index.d.ts +1 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +4 -1
- package/esm/RadarChart/useRadarChartProps.js +15 -3
- package/esm/ScatterChart/ScatterChart.d.ts +3 -2
- package/esm/ScatterChart/ScatterChart.js +95 -2
- package/esm/ScatterChart/seriesConfig/extremums.js +50 -23
- package/esm/ScatterChart/useScatterChartProps.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +93 -0
- package/esm/hooks/useTicks.d.ts +6 -1
- package/esm/hooks/useTicks.js +94 -58
- package/esm/index.d.ts +2 -1
- package/esm/index.js +6 -2
- package/esm/internals/findMinMax.d.ts +1 -0
- package/esm/internals/findMinMax.js +13 -0
- package/esm/internals/getScale.js +3 -0
- package/esm/internals/index.d.ts +1 -1
- package/esm/internals/index.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +19 -11
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +19 -11
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +17 -12
- package/esm/internals/symlogScale.d.ts +2 -0
- package/esm/internals/symlogScale.js +94 -0
- package/esm/models/axis.d.ts +47 -5
- package/esm/models/axis.js +3 -0
- package/esm/models/seriesType/bar.d.ts +11 -1
- package/esm/models/seriesType/common.d.ts +9 -3
- package/esm/models/seriesType/line.d.ts +3 -1
- package/esm/models/seriesType/scatter.d.ts +4 -1
- package/esm/tests/web-components.js +49 -0
- package/hooks/useTicks.d.ts +6 -1
- package/hooks/useTicks.js +95 -58
- package/index.d.ts +2 -1
- package/index.js +13 -1
- package/internals/findMinMax.d.ts +1 -0
- package/internals/findMinMax.js +19 -0
- package/internals/getScale.js +3 -0
- package/internals/index.d.ts +1 -1
- package/internals/index.js +12 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +3 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +20 -13
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +20 -13
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +17 -12
- package/internals/symlogScale.d.ts +2 -0
- package/internals/symlogScale.js +100 -0
- package/models/axis.d.ts +47 -5
- package/models/axis.js +4 -0
- package/models/seriesType/bar.d.ts +11 -1
- package/models/seriesType/common.d.ts +9 -3
- package/models/seriesType/line.d.ts +3 -1
- package/models/seriesType/scatter.d.ts +4 -1
- package/package.json +6 -7
- package/tests/web-components.js +55 -0
- package/BarChart/getRadius.d.ts +0 -20
- package/BarChart/getRadius.js +0 -37
- package/esm/BarChart/getRadius.d.ts +0 -20
- package/esm/BarChart/getRadius.js +0 -30
- /package/{esm/internals/components/ChartsWrapper → ChartsWrapper}/index.d.ts +0 -0
- /package/{internals/components/ChartsWrapper → ChartsWrapper}/index.js +0 -0
- /package/{internals/components → esm}/ChartsWrapper/index.d.ts +0 -0
- /package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/index.js +0 -0
|
@@ -2,16 +2,17 @@ import * as React from 'react';
|
|
|
2
2
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from "../ChartsLegend/index.js";
|
|
3
3
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
4
4
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
5
|
-
import { ChartsWrapperProps } from "../
|
|
5
|
+
import { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
6
6
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
7
7
|
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
8
|
+
import { RadarSeriesPlotProps } from "./RadarSeriesPlot/index.js";
|
|
8
9
|
import { RadarAxisHighlightProps } from "./RadarAxisHighlight/index.js";
|
|
9
10
|
import { ChartsTooltipSlotProps, ChartsTooltipSlots } from "../ChartsTooltip/index.js";
|
|
10
11
|
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
11
12
|
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
|
|
12
13
|
export interface RadarChartSlots extends ChartsTooltipSlots, ChartsOverlaySlots, ChartsLegendSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
13
14
|
export interface RadarChartSlotProps extends ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsLegendSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
14
|
-
export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridProps, 'classes'>, Omit<Partial<RadarAxisHighlightProps>, 'classes'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ChartsWrapperProps, 'sx'>, Omit<ChartsSurfaceProps, 'sx'> {
|
|
15
|
+
export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridProps, 'classes'>, Omit<Partial<RadarAxisHighlightProps>, 'classes'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ChartsWrapperProps, 'sx'>, Omit<ChartsSurfaceProps, 'sx'>, Pick<RadarSeriesPlotProps, 'onAreaClick' | 'onMarkClick'> {
|
|
15
16
|
/**
|
|
16
17
|
* If `true`, the legend is not rendered.
|
|
17
18
|
*/
|
|
@@ -8,7 +8,7 @@ import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
|
8
8
|
import { ChartsOverlay } from "../ChartsOverlay/ChartsOverlay.js";
|
|
9
9
|
import { useRadarChartProps } from "./useRadarChartProps.js";
|
|
10
10
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
11
|
-
import { ChartsWrapper } from "../
|
|
11
|
+
import { ChartsWrapper } from "../ChartsWrapper/index.js";
|
|
12
12
|
import { RadarGrid } from "./RadarGrid/index.js";
|
|
13
13
|
import { RadarDataProvider } from "./RadarDataProvider/RadarDataProvider.js";
|
|
14
14
|
import { RadarSeriesArea, RadarSeriesMarks } from "./RadarSeriesPlot/index.js";
|
|
@@ -35,6 +35,8 @@ const RadarChart = /*#__PURE__*/React.forwardRef(function RadarChart(inProps, re
|
|
|
35
35
|
chartsSurfaceProps,
|
|
36
36
|
radarDataProviderProps,
|
|
37
37
|
radarGrid,
|
|
38
|
+
radarSeriesAreaProps,
|
|
39
|
+
radarSeriesMarksProps,
|
|
38
40
|
overlayProps,
|
|
39
41
|
legendProps,
|
|
40
42
|
highlight,
|
|
@@ -46,7 +48,7 @@ const RadarChart = /*#__PURE__*/React.forwardRef(function RadarChart(inProps, re
|
|
|
46
48
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
47
49
|
children: [props.showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
48
50
|
ref: ref,
|
|
49
|
-
children: [/*#__PURE__*/_jsx(RadarGrid, _extends({}, radarGrid)), /*#__PURE__*/_jsx(RadarMetricLabels, {}), /*#__PURE__*/_jsx(RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/_jsx(RadarAxisHighlight, {}), /*#__PURE__*/_jsx(RadarSeriesMarks, {}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), children]
|
|
51
|
+
children: [/*#__PURE__*/_jsx(RadarGrid, _extends({}, radarGrid)), /*#__PURE__*/_jsx(RadarMetricLabels, {}), /*#__PURE__*/_jsx(RadarSeriesArea, _extends({}, radarSeriesAreaProps)), highlight === 'axis' && /*#__PURE__*/_jsx(RadarAxisHighlight, {}), /*#__PURE__*/_jsx(RadarSeriesMarks, _extends({}, radarSeriesMarksProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), children]
|
|
50
52
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
51
53
|
}))
|
|
52
54
|
}));
|
|
@@ -125,12 +127,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
125
127
|
right: PropTypes.number,
|
|
126
128
|
top: PropTypes.number
|
|
127
129
|
})]),
|
|
130
|
+
/**
|
|
131
|
+
* Callback fired when an area is clicked.
|
|
132
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
133
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
134
|
+
*/
|
|
135
|
+
onAreaClick: PropTypes.func,
|
|
136
|
+
/**
|
|
137
|
+
* The function called for onClick events.
|
|
138
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
139
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
140
|
+
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
141
|
+
*/
|
|
142
|
+
onAxisClick: PropTypes.func,
|
|
128
143
|
/**
|
|
129
144
|
* The callback fired when the highlighted item changes.
|
|
130
145
|
*
|
|
131
146
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
132
147
|
*/
|
|
133
148
|
onHighlightChange: PropTypes.func,
|
|
149
|
+
/**
|
|
150
|
+
* Callback fired when a mark is clicked.
|
|
151
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
152
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
153
|
+
*/
|
|
154
|
+
onMarkClick: PropTypes.func,
|
|
134
155
|
/**
|
|
135
156
|
* The configuration of the radar scales.
|
|
136
157
|
*/
|
|
@@ -147,7 +168,7 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
147
168
|
}).isRequired,
|
|
148
169
|
/**
|
|
149
170
|
* The series to display in the bar chart.
|
|
150
|
-
* An array of [[
|
|
171
|
+
* An array of [[RadarSeries]] objects.
|
|
151
172
|
*/
|
|
152
173
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
153
174
|
/**
|
|
@@ -5,12 +5,13 @@ import { RadarSeriesType } from "../../models/seriesType/radar.js";
|
|
|
5
5
|
import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
|
|
6
6
|
import { RadarConfig } from "./radar.types.js";
|
|
7
7
|
import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
|
|
8
|
+
export type RadarSeries = MakeOptional<RadarSeriesType, 'type'>;
|
|
8
9
|
export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
|
|
9
10
|
/**
|
|
10
11
|
* The series to display in the bar chart.
|
|
11
|
-
* An array of [[
|
|
12
|
+
* An array of [[RadarSeries]] objects.
|
|
12
13
|
*/
|
|
13
|
-
series: Readonly<
|
|
14
|
+
series: Readonly<RadarSeries>[];
|
|
14
15
|
/**
|
|
15
16
|
* The configuration of the radar scales.
|
|
16
17
|
*/
|
|
@@ -21,14 +21,16 @@ export function useRadarMetricData() {
|
|
|
21
21
|
const radiusScale = radiusAxis[metric].scale;
|
|
22
22
|
const r = radiusScale.range()[1] + labelGap;
|
|
23
23
|
const angle = angles[dataIndex];
|
|
24
|
+
const defaultTickLabel = metric;
|
|
24
25
|
return {
|
|
25
26
|
x: cx + r * Math.sin(angle),
|
|
26
27
|
y: cy - r * Math.cos(angle),
|
|
27
28
|
angle: rad2deg(angle),
|
|
28
29
|
label: valueFormatter?.(metric, {
|
|
29
30
|
location: 'tick',
|
|
30
|
-
scale: rotationScale
|
|
31
|
-
|
|
31
|
+
scale: rotationScale,
|
|
32
|
+
defaultTickLabel
|
|
33
|
+
}) ?? defaultTickLabel
|
|
32
34
|
};
|
|
33
35
|
})
|
|
34
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId"];
|
|
3
|
+
const _excluded = ["seriesId", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -9,6 +9,7 @@ import { getAreaPath } from "./getAreaPath.js";
|
|
|
9
9
|
import { useUtilityClasses } from "./radarSeriesPlotClasses.js";
|
|
10
10
|
import { useItemHighlightedGetter } from "../../hooks/useItemHighlightedGetter.js";
|
|
11
11
|
import { useInteractionAllItemProps } from "../../hooks/useInteractionItemProps.js";
|
|
12
|
+
import { useRadarRotationIndex } from "./useRadarRotationIndex.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
export function getPathProps(params) {
|
|
14
15
|
const {
|
|
@@ -38,10 +39,12 @@ export function getPathProps(params) {
|
|
|
38
39
|
}
|
|
39
40
|
function RadarSeriesArea(props) {
|
|
40
41
|
const {
|
|
41
|
-
seriesId
|
|
42
|
+
seriesId,
|
|
43
|
+
onItemClick
|
|
42
44
|
} = props,
|
|
43
45
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
44
46
|
const seriesCoordinates = useRadarSeriesData(seriesId);
|
|
47
|
+
const getRotationIndex = useRadarRotationIndex();
|
|
45
48
|
const interactionProps = useInteractionAllItemProps(seriesCoordinates);
|
|
46
49
|
const {
|
|
47
50
|
isFaded,
|
|
@@ -63,7 +66,14 @@ function RadarSeriesArea(props) {
|
|
|
63
66
|
isFaded,
|
|
64
67
|
isHighlighted,
|
|
65
68
|
classes
|
|
66
|
-
}),
|
|
69
|
+
}), {
|
|
70
|
+
onClick: event => onItemClick?.(event, {
|
|
71
|
+
type: 'radar',
|
|
72
|
+
seriesId: id,
|
|
73
|
+
dataIndex: getRotationIndex(event)
|
|
74
|
+
}),
|
|
75
|
+
cursor: onItemClick ? 'pointer' : 'unset'
|
|
76
|
+
}, interactionProps[seriesIndex], other), id);
|
|
67
77
|
})
|
|
68
78
|
});
|
|
69
79
|
}
|
|
@@ -76,6 +86,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesArea.propTypes = {
|
|
|
76
86
|
* Override or extend the styles applied to the component.
|
|
77
87
|
*/
|
|
78
88
|
classes: PropTypes.object,
|
|
89
|
+
/**
|
|
90
|
+
* Callback fired when an area is clicked.
|
|
91
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
92
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
93
|
+
*/
|
|
94
|
+
onItemClick: PropTypes.func,
|
|
79
95
|
/**
|
|
80
96
|
* The id of the series to display.
|
|
81
97
|
* If undefined all series are displayed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId"];
|
|
3
|
+
const _excluded = ["seriesId", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -31,12 +31,14 @@ export function getCircleProps(params) {
|
|
|
31
31
|
fill: color,
|
|
32
32
|
stroke: color,
|
|
33
33
|
opacity: fillArea && isItemFaded ? 0.5 : 1,
|
|
34
|
-
pointerEvents: 'none',
|
|
35
34
|
className: clsx(classes.mark, isItemHighlighted && classes.highlighted || isItemFaded && classes.faded)
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
function RadarSeriesMarks(props) {
|
|
39
|
-
const
|
|
38
|
+
const {
|
|
39
|
+
onItemClick
|
|
40
|
+
} = props,
|
|
41
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
42
|
const seriesCoordinates = useRadarSeriesData(props.seriesId);
|
|
41
43
|
const classes = useUtilityClasses(props.classes);
|
|
42
44
|
const {
|
|
@@ -63,7 +65,15 @@ function RadarSeriesMarks(props) {
|
|
|
63
65
|
isFaded,
|
|
64
66
|
isHighlighted,
|
|
65
67
|
classes
|
|
66
|
-
}),
|
|
68
|
+
}), {
|
|
69
|
+
pointerEvents: onItemClick ? undefined : 'none',
|
|
70
|
+
onClick: event => onItemClick?.(event, {
|
|
71
|
+
type: 'radar',
|
|
72
|
+
seriesId: id,
|
|
73
|
+
dataIndex: index
|
|
74
|
+
}),
|
|
75
|
+
cursor: onItemClick ? 'pointer' : 'unset'
|
|
76
|
+
}, other), index))
|
|
67
77
|
}, id);
|
|
68
78
|
})
|
|
69
79
|
});
|
|
@@ -77,6 +87,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes = {
|
|
|
77
87
|
* Override or extend the styles applied to the component.
|
|
78
88
|
*/
|
|
79
89
|
classes: PropTypes.object,
|
|
90
|
+
/**
|
|
91
|
+
* Callback fired when a mark is clicked.
|
|
92
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
93
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
94
|
+
*/
|
|
95
|
+
onItemClick: PropTypes.func,
|
|
80
96
|
/**
|
|
81
97
|
* The id of the series to display.
|
|
82
98
|
* If undefined all series are displayed.
|
|
@@ -7,15 +7,23 @@ import { useItemHighlightedGetter } from "../../hooks/useItemHighlightedGetter.j
|
|
|
7
7
|
import { useUtilityClasses } from "./radarSeriesPlotClasses.js";
|
|
8
8
|
import { getPathProps } from "./RadarSeriesArea.js";
|
|
9
9
|
import { getCircleProps } from "./RadarSeriesMarks.js";
|
|
10
|
+
import { useRadarRotationIndex } from "./useRadarRotationIndex.js";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
function RadarSeriesPlot(props) {
|
|
12
|
-
const
|
|
13
|
+
const {
|
|
14
|
+
seriesId: inSeriesId,
|
|
15
|
+
classes: inClasses,
|
|
16
|
+
onAreaClick,
|
|
17
|
+
onMarkClick
|
|
18
|
+
} = props;
|
|
19
|
+
const seriesCoordinates = useRadarSeriesData(inSeriesId);
|
|
20
|
+
const getRotationIndex = useRadarRotationIndex();
|
|
13
21
|
const interactionProps = useInteractionAllItemProps(seriesCoordinates);
|
|
14
22
|
const {
|
|
15
23
|
isFaded,
|
|
16
24
|
isHighlighted
|
|
17
25
|
} = useItemHighlightedGetter();
|
|
18
|
-
const classes = useUtilityClasses(
|
|
26
|
+
const classes = useUtilityClasses(inClasses);
|
|
19
27
|
return /*#__PURE__*/_jsx("g", {
|
|
20
28
|
className: classes.root,
|
|
21
29
|
children: seriesCoordinates?.map(({
|
|
@@ -34,7 +42,14 @@ function RadarSeriesPlot(props) {
|
|
|
34
42
|
isFaded,
|
|
35
43
|
isHighlighted,
|
|
36
44
|
classes
|
|
37
|
-
}),
|
|
45
|
+
}), {
|
|
46
|
+
onClick: event => onAreaClick?.(event, {
|
|
47
|
+
type: 'radar',
|
|
48
|
+
seriesId,
|
|
49
|
+
dataIndex: getRotationIndex(event)
|
|
50
|
+
}),
|
|
51
|
+
cursor: onAreaClick ? 'pointer' : 'unset'
|
|
52
|
+
}, interactionProps[seriesIndex]), seriesId), !hideMark && points.map((point, index) => /*#__PURE__*/_jsx("circle", _extends({}, getCircleProps({
|
|
38
53
|
seriesId,
|
|
39
54
|
point,
|
|
40
55
|
color,
|
|
@@ -42,7 +57,14 @@ function RadarSeriesPlot(props) {
|
|
|
42
57
|
isFaded,
|
|
43
58
|
isHighlighted,
|
|
44
59
|
classes
|
|
45
|
-
})
|
|
60
|
+
}), {
|
|
61
|
+
onClick: event => onMarkClick?.(event, {
|
|
62
|
+
type: 'radar',
|
|
63
|
+
seriesId,
|
|
64
|
+
dataIndex: index
|
|
65
|
+
}),
|
|
66
|
+
cursor: onMarkClick ? 'pointer' : 'unset'
|
|
67
|
+
}), index))]
|
|
46
68
|
}, seriesId);
|
|
47
69
|
})
|
|
48
70
|
});
|
|
@@ -56,6 +78,18 @@ process.env.NODE_ENV !== "production" ? RadarSeriesPlot.propTypes = {
|
|
|
56
78
|
* Override or extend the styles applied to the component.
|
|
57
79
|
*/
|
|
58
80
|
classes: PropTypes.object,
|
|
81
|
+
/**
|
|
82
|
+
* Callback fired when an area is clicked.
|
|
83
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
84
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
85
|
+
*/
|
|
86
|
+
onAreaClick: PropTypes.func,
|
|
87
|
+
/**
|
|
88
|
+
* Callback fired when a mark is clicked.
|
|
89
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
90
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
91
|
+
*/
|
|
92
|
+
onMarkClick: PropTypes.func,
|
|
59
93
|
/**
|
|
60
94
|
* The id of the series to display.
|
|
61
95
|
* If undefined all series are displayed.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RadarSeriesPlotClasses } from "./radarSeriesPlotClasses.js";
|
|
3
|
+
import { RadarItemIdentifier } from "../../models/seriesType/radar.js";
|
|
3
4
|
interface CommonRadarSeriesPlotProps {
|
|
4
5
|
/**
|
|
5
6
|
* The id of the series to display.
|
|
@@ -11,7 +12,35 @@ interface CommonRadarSeriesPlotProps {
|
|
|
11
12
|
*/
|
|
12
13
|
classes?: Partial<RadarSeriesPlotClasses>;
|
|
13
14
|
}
|
|
14
|
-
export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {
|
|
16
|
+
/**
|
|
17
|
+
* Callback fired when an area is clicked.
|
|
18
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
19
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
20
|
+
*/
|
|
21
|
+
onAreaClick?: RadarSeriesAreaProps['onItemClick'];
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when a mark is clicked.
|
|
24
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
25
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
26
|
+
*/
|
|
27
|
+
onMarkClick?: RadarSeriesMarksProps['onItemClick'];
|
|
28
|
+
}
|
|
29
|
+
type RadarClickIdentifier = Required<RadarItemIdentifier>;
|
|
30
|
+
export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {
|
|
31
|
+
/**
|
|
32
|
+
* Callback fired when a mark is clicked.
|
|
33
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
34
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
35
|
+
*/
|
|
36
|
+
onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {
|
|
39
|
+
/**
|
|
40
|
+
* Callback fired when an area is clicked.
|
|
41
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
42
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
43
|
+
*/
|
|
44
|
+
onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
|
|
45
|
+
}
|
|
17
46
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook provides a function that from pointer event returns the rotation index.
|
|
3
|
+
* @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRadarRotationIndex(): (event: {
|
|
6
|
+
clientX: number;
|
|
7
|
+
clientY: number;
|
|
8
|
+
}) => number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { selectorChartPolarCenter } from "../../internals/plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
3
|
+
import { getSVGPoint } from "../../internals/getSVGPoint.js";
|
|
4
|
+
import { generateSvg2rotation } from "../../internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js";
|
|
5
|
+
import { useSelector } from "../../internals/store/useSelector.js";
|
|
6
|
+
import { getAxisIndex } from "../../internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js";
|
|
7
|
+
import { useStore } from "../../internals/store/useStore.js";
|
|
8
|
+
import { useSvgRef } from "../../hooks/useSvgRef.js";
|
|
9
|
+
import { useRotationAxis } from "../../hooks/useAxis.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This hook provides a function that from pointer event returns the rotation index.
|
|
13
|
+
* @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
|
|
14
|
+
*/
|
|
15
|
+
export function useRadarRotationIndex() {
|
|
16
|
+
const svgRef = useSvgRef();
|
|
17
|
+
const store = useStore();
|
|
18
|
+
const rotationAxis = useRotationAxis();
|
|
19
|
+
const center = useSelector(store, selectorChartPolarCenter);
|
|
20
|
+
const rotationIndexGetter = React.useCallback(function rotationIndexGetter(event) {
|
|
21
|
+
const element = svgRef.current;
|
|
22
|
+
if (!element || !rotationAxis) {
|
|
23
|
+
// Should never append
|
|
24
|
+
throw new Error(`MUI X Charts: The ${!element ? 'SVG' : 'rotation axis'} was not found to compute radar dataIndex.`);
|
|
25
|
+
}
|
|
26
|
+
const svgPoint = getSVGPoint(element, event);
|
|
27
|
+
const rotation = generateSvg2rotation(center)(svgPoint.x, svgPoint.y);
|
|
28
|
+
const rotationIndex = getAxisIndex(rotationAxis, rotation);
|
|
29
|
+
return rotationIndex;
|
|
30
|
+
}, [center, rotationAxis, svgRef]);
|
|
31
|
+
return rotationIndexGetter;
|
|
32
|
+
}
|
|
@@ -17,8 +17,8 @@ export declare function useRadarSeriesData(querySeriesId?: SeriesId): {
|
|
|
17
17
|
}[];
|
|
18
18
|
type: "radar";
|
|
19
19
|
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
20
|
-
highlightScope?:
|
|
21
|
-
labelMarkType?:
|
|
20
|
+
highlightScope?: import("../../index.js").HighlightScope | undefined;
|
|
21
|
+
labelMarkType?: import("../../internals/index.js").ChartsLabelMarkType | undefined;
|
|
22
22
|
hideMark?: boolean | undefined;
|
|
23
23
|
fillArea?: boolean | undefined;
|
|
24
24
|
data: number[];
|
|
@@ -3,7 +3,7 @@ export { RadarChart } from "./RadarChart.js";
|
|
|
3
3
|
export { RadarDataProvider as Unstable_RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
4
4
|
export { RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
5
5
|
export type { RadarChartProps, RadarChartSlots, RadarChartSlotProps } from "./RadarChart.js";
|
|
6
|
-
export type { RadarDataProviderProps } from "./RadarDataProvider/index.js";
|
|
6
|
+
export type { RadarDataProviderProps, RadarSeries } from "./RadarDataProvider/index.js";
|
|
7
7
|
export * from "./RadarGrid/index.js";
|
|
8
8
|
export * from "./RadarAxisHighlight/index.js";
|
|
9
9
|
export * from "./RadarMetricLabels/index.js";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RadarChartProps } from "./RadarChart.js";
|
|
2
2
|
import { ChartsOverlayProps } from "../ChartsOverlay/index.js";
|
|
3
3
|
import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
|
|
4
|
-
import type { ChartsWrapperProps } from "../
|
|
4
|
+
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
5
5
|
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
6
6
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
7
7
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
8
8
|
import { RadarChartPluginsSignatures } from "./RadarChart.plugins.js";
|
|
9
|
+
import { RadarSeriesAreaProps, RadarSeriesMarksProps } from "./RadarSeriesPlot/index.js";
|
|
9
10
|
/**
|
|
10
11
|
* A helper function that extracts RadarChartProps from the input props
|
|
11
12
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -19,6 +20,8 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
|
|
|
19
20
|
chartsSurfaceProps: ChartsSurfaceProps;
|
|
20
21
|
radarDataProviderProps: RadarDataProviderProps<RadarChartPluginsSignatures>;
|
|
21
22
|
radarGrid: RadarGridProps;
|
|
23
|
+
radarSeriesAreaProps: RadarSeriesAreaProps;
|
|
24
|
+
radarSeriesMarksProps: RadarSeriesMarksProps;
|
|
22
25
|
overlayProps: ChartsOverlayProps;
|
|
23
26
|
legendProps: ChartsLegendSlotExtension;
|
|
24
27
|
children: import("react").ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar"];
|
|
4
|
+
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick"];
|
|
5
5
|
/**
|
|
6
6
|
* A helper function that extracts RadarChartProps from the input props
|
|
7
7
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -29,7 +29,10 @@ export const useRadarChartProps = props => {
|
|
|
29
29
|
divisions,
|
|
30
30
|
shape,
|
|
31
31
|
stripeColor,
|
|
32
|
-
highlight = 'axis'
|
|
32
|
+
highlight = 'axis',
|
|
33
|
+
onAxisClick,
|
|
34
|
+
onAreaClick,
|
|
35
|
+
onMarkClick
|
|
33
36
|
} = props,
|
|
34
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
35
38
|
const radarDataProviderProps = {
|
|
@@ -43,7 +46,8 @@ export const useRadarChartProps = props => {
|
|
|
43
46
|
colors,
|
|
44
47
|
highlightedItem,
|
|
45
48
|
onHighlightChange,
|
|
46
|
-
skipAnimation
|
|
49
|
+
skipAnimation,
|
|
50
|
+
onAxisClick
|
|
47
51
|
};
|
|
48
52
|
const overlayProps = {
|
|
49
53
|
slots,
|
|
@@ -62,6 +66,12 @@ export const useRadarChartProps = props => {
|
|
|
62
66
|
shape,
|
|
63
67
|
stripeColor
|
|
64
68
|
};
|
|
69
|
+
const radarSeriesAreaProps = {
|
|
70
|
+
onItemClick: onAreaClick
|
|
71
|
+
};
|
|
72
|
+
const radarSeriesMarksProps = {
|
|
73
|
+
onItemClick: onMarkClick
|
|
74
|
+
};
|
|
65
75
|
const chartsSurfaceProps = other;
|
|
66
76
|
return {
|
|
67
77
|
highlight,
|
|
@@ -69,6 +79,8 @@ export const useRadarChartProps = props => {
|
|
|
69
79
|
chartsSurfaceProps,
|
|
70
80
|
radarDataProviderProps,
|
|
71
81
|
radarGrid,
|
|
82
|
+
radarSeriesAreaProps,
|
|
83
|
+
radarSeriesMarksProps,
|
|
72
84
|
overlayProps,
|
|
73
85
|
legendProps,
|
|
74
86
|
children
|
|
@@ -16,12 +16,13 @@ import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/us
|
|
|
16
16
|
import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
|
|
17
17
|
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
18
18
|
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
19
|
+
export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
|
|
19
20
|
export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
20
21
|
/**
|
|
21
22
|
* The series to display in the scatter chart.
|
|
22
|
-
* An array of [[
|
|
23
|
+
* An array of [[ScatterSeries]] objects.
|
|
23
24
|
*/
|
|
24
|
-
series: Readonly<
|
|
25
|
+
series: Readonly<ScatterSeries[]>;
|
|
25
26
|
/**
|
|
26
27
|
* The configuration of axes highlight.
|
|
27
28
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -15,7 +15,7 @@ import { useScatterChartProps } from "./useScatterChartProps.js";
|
|
|
15
15
|
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
16
16
|
import { ChartDataProvider } from "../ChartDataProvider/index.js";
|
|
17
17
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
18
|
-
import { ChartsWrapper } from "../
|
|
18
|
+
import { ChartsWrapper } from "../ChartsWrapper/index.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
/**
|
|
21
21
|
* Demos:
|
|
@@ -173,7 +173,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
173
173
|
onItemClick: PropTypes.func,
|
|
174
174
|
/**
|
|
175
175
|
* The series to display in the scatter chart.
|
|
176
|
-
* An array of [[
|
|
176
|
+
* An array of [[ScatterSeries]] objects.
|
|
177
177
|
*/
|
|
178
178
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
179
179
|
/**
|
|
@@ -363,6 +363,53 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
363
363
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
364
364
|
tickSize: PropTypes.number,
|
|
365
365
|
valueFormatter: PropTypes.func
|
|
366
|
+
}), PropTypes.shape({
|
|
367
|
+
axis: PropTypes.oneOf(['x']),
|
|
368
|
+
classes: PropTypes.object,
|
|
369
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
370
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
371
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
372
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
373
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
374
|
+
}), PropTypes.shape({
|
|
375
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
376
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
377
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
378
|
+
})]),
|
|
379
|
+
constant: PropTypes.number,
|
|
380
|
+
data: PropTypes.array,
|
|
381
|
+
dataKey: PropTypes.string,
|
|
382
|
+
disableLine: PropTypes.bool,
|
|
383
|
+
disableTicks: PropTypes.bool,
|
|
384
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
385
|
+
fill: PropTypes.string,
|
|
386
|
+
height: PropTypes.number,
|
|
387
|
+
hideTooltip: PropTypes.bool,
|
|
388
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
389
|
+
ignoreTooltip: PropTypes.bool,
|
|
390
|
+
label: PropTypes.string,
|
|
391
|
+
labelStyle: PropTypes.object,
|
|
392
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
393
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
394
|
+
offset: PropTypes.number,
|
|
395
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
396
|
+
reverse: PropTypes.bool,
|
|
397
|
+
scaleType: PropTypes.oneOf(['symlog']),
|
|
398
|
+
slotProps: PropTypes.object,
|
|
399
|
+
slots: PropTypes.object,
|
|
400
|
+
stroke: PropTypes.string,
|
|
401
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
402
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
403
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
404
|
+
tickLabelMinGap: PropTypes.number,
|
|
405
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
406
|
+
tickLabelStyle: PropTypes.object,
|
|
407
|
+
tickMaxStep: PropTypes.number,
|
|
408
|
+
tickMinStep: PropTypes.number,
|
|
409
|
+
tickNumber: PropTypes.number,
|
|
410
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
411
|
+
tickSize: PropTypes.number,
|
|
412
|
+
valueFormatter: PropTypes.func
|
|
366
413
|
}), PropTypes.shape({
|
|
367
414
|
axis: PropTypes.oneOf(['x']),
|
|
368
415
|
classes: PropTypes.object,
|
|
@@ -746,6 +793,52 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
746
793
|
tickSize: PropTypes.number,
|
|
747
794
|
valueFormatter: PropTypes.func,
|
|
748
795
|
width: PropTypes.number
|
|
796
|
+
}), PropTypes.shape({
|
|
797
|
+
axis: PropTypes.oneOf(['y']),
|
|
798
|
+
classes: PropTypes.object,
|
|
799
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
800
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
801
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
802
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
803
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
804
|
+
}), PropTypes.shape({
|
|
805
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
806
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
807
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
808
|
+
})]),
|
|
809
|
+
constant: PropTypes.number,
|
|
810
|
+
data: PropTypes.array,
|
|
811
|
+
dataKey: PropTypes.string,
|
|
812
|
+
disableLine: PropTypes.bool,
|
|
813
|
+
disableTicks: PropTypes.bool,
|
|
814
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
815
|
+
fill: PropTypes.string,
|
|
816
|
+
hideTooltip: PropTypes.bool,
|
|
817
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
818
|
+
ignoreTooltip: PropTypes.bool,
|
|
819
|
+
label: PropTypes.string,
|
|
820
|
+
labelStyle: PropTypes.object,
|
|
821
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
822
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
823
|
+
offset: PropTypes.number,
|
|
824
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
825
|
+
reverse: PropTypes.bool,
|
|
826
|
+
scaleType: PropTypes.oneOf(['symlog']),
|
|
827
|
+
slotProps: PropTypes.object,
|
|
828
|
+
slots: PropTypes.object,
|
|
829
|
+
stroke: PropTypes.string,
|
|
830
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
831
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
832
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
833
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
834
|
+
tickLabelStyle: PropTypes.object,
|
|
835
|
+
tickMaxStep: PropTypes.number,
|
|
836
|
+
tickMinStep: PropTypes.number,
|
|
837
|
+
tickNumber: PropTypes.number,
|
|
838
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
839
|
+
tickSize: PropTypes.number,
|
|
840
|
+
valueFormatter: PropTypes.func,
|
|
841
|
+
width: PropTypes.number
|
|
749
842
|
}), PropTypes.shape({
|
|
750
843
|
axis: PropTypes.oneOf(['y']),
|
|
751
844
|
classes: PropTypes.object,
|