@mui/x-charts 8.7.0 → 8.9.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/BarChart/BarChart.d.ts +4 -3
- package/BarChart/BarChart.js +17 -1
- package/BarChart/barClasses.d.ts +1 -1
- package/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/BarChart/useBarPlotData.js +32 -5
- package/CHANGELOG.md +199 -24
- package/ChartContainer/ChartContainer.js +22 -0
- package/ChartContainer/useChartContainerProps.js +8 -2
- package/ChartDataProvider/ChartDataProvider.js +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartDataProvider/useChartDataProviderProps.js +6 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
- 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/Gauge/GaugeContainer.d.ts +1 -1
- package/LineChart/LineChart.d.ts +3 -2
- package/LineChart/LineChart.js +23 -1
- package/LineChart/LineHighlightPlot.js +10 -4
- package/LineChart/MarkPlot.js +17 -3
- package/LineChart/useAreaPlotData.js +3 -2
- package/PieChart/PieArcLabelPlot.js +3 -0
- package/PieChart/PieArcPlot.js +3 -0
- package/PieChart/PieChart.d.ts +4 -3
- package/PieChart/PieChart.js +1 -1
- 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 +2 -1
- package/RadarChart/RadarChart.js +23 -2
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
- 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 +3 -0
- package/RadarChart/useRadarChartProps.js +15 -3
- package/ScatterChart/ScatterChart.d.ts +4 -3
- package/ScatterChart/ScatterChart.js +1 -1
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/BarChart/BarChart.d.ts +4 -3
- package/esm/BarChart/BarChart.js +17 -1
- package/esm/BarChart/barClasses.d.ts +1 -1
- package/esm/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/esm/BarChart/useBarPlotData.js +32 -5
- package/esm/ChartContainer/ChartContainer.js +22 -0
- package/esm/ChartContainer/useChartContainerProps.js +8 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
- 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/Gauge/GaugeContainer.d.ts +1 -1
- package/esm/LineChart/LineChart.d.ts +3 -2
- package/esm/LineChart/LineChart.js +23 -1
- package/esm/LineChart/LineHighlightPlot.js +11 -5
- package/esm/LineChart/MarkPlot.js +17 -3
- package/esm/LineChart/useAreaPlotData.js +3 -2
- package/esm/PieChart/PieArcLabelPlot.js +3 -0
- package/esm/PieChart/PieArcPlot.js +3 -0
- package/esm/PieChart/PieChart.d.ts +4 -3
- package/esm/PieChart/PieChart.js +1 -1
- 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 +2 -1
- package/esm/RadarChart/RadarChart.js +23 -2
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
- 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 +3 -0
- package/esm/RadarChart/useRadarChartProps.js +15 -3
- package/esm/ScatterChart/ScatterChart.d.ts +4 -3
- package/esm/ScatterChart/ScatterChart.js +1 -1
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/hooks/useAxis.d.ts +2 -2
- package/esm/hooks/useTicks.d.ts +6 -1
- package/esm/hooks/useTicks.js +94 -58
- package/esm/index.js +1 -1
- package/esm/internals/constants.d.ts +3 -0
- package/esm/internals/constants.js +4 -0
- package/esm/internals/getLabel.d.ts +1 -1
- package/esm/internals/index.d.ts +1 -0
- package/esm/internals/index.js +1 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -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.d.ts +5 -5
- 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/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
- package/esm/internals/store/useCharts.d.ts +1 -1
- package/esm/models/axis.d.ts +42 -1
- package/esm/models/axis.js +4 -0
- package/esm/models/index.d.ts +1 -1
- 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 +14 -2
- package/esm/tests/web-components.js +49 -0
- package/esm/themeAugmentation/components.d.ts +3 -0
- package/esm/themeAugmentation/props.d.ts +2 -0
- package/hooks/useAxis.d.ts +2 -2
- package/hooks/useTicks.d.ts +6 -1
- package/hooks/useTicks.js +95 -58
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +5 -1
- package/internals/getLabel.d.ts +1 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- 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.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
- package/internals/store/useCharts.d.ts +1 -1
- package/models/axis.d.ts +42 -1
- package/models/axis.js +4 -0
- package/models/index.d.ts +1 -1
- 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 +14 -2
- package/package.json +5 -5
- package/tests/web-components.js +55 -0
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
|
@@ -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
|
|
19
|
+
export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
|
|
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.
|
|
@@ -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
|
/**
|
|
@@ -5,9 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { Scatter } from "./Scatter.js";
|
|
7
7
|
import { useScatterSeriesContext } from "../hooks/useScatterSeries.js";
|
|
8
|
-
import getColor from "./seriesConfig/getColor.js";
|
|
9
8
|
import { useXAxes, useYAxes } from "../hooks/index.js";
|
|
10
9
|
import { useZAxes } from "../hooks/useZAxis.js";
|
|
10
|
+
import { seriesConfig as scatterSeriesConfig } from "./seriesConfig/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
13
|
* Demos:
|
|
@@ -58,7 +58,7 @@ function ScatterPlot(props) {
|
|
|
58
58
|
zAxisId,
|
|
59
59
|
color
|
|
60
60
|
} = series[seriesId];
|
|
61
|
-
const colorGetter =
|
|
61
|
+
const colorGetter = scatterSeriesConfig.colorProcessor(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
|
|
62
62
|
const xScale = xAxis[xAxisId ?? defaultXAxisId].scale;
|
|
63
63
|
const yScale = yAxis[yAxisId ?? defaultYAxisId].scale;
|
|
64
64
|
return /*#__PURE__*/_jsx(ScatterItems, _extends({
|
|
@@ -13,7 +13,7 @@ import { BarPlotSlots, BarPlotSlotProps } from "../BarChart/BarPlot.js";
|
|
|
13
13
|
import { ChartMargin } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js";
|
|
14
14
|
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {}
|
|
15
15
|
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {}
|
|
16
|
-
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps'> {
|
|
16
|
+
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
17
17
|
/**
|
|
18
18
|
* The xAxis configuration.
|
|
19
19
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
@@ -206,6 +206,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
206
206
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
207
207
|
*/
|
|
208
208
|
height: PropTypes.number,
|
|
209
|
+
/**
|
|
210
|
+
* The controlled axis highlight.
|
|
211
|
+
* Identified by the axis id, and data index.
|
|
212
|
+
*/
|
|
213
|
+
highlightedAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
214
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
215
|
+
dataIndex: PropTypes.number.isRequired
|
|
216
|
+
})),
|
|
209
217
|
/**
|
|
210
218
|
* The highlighted item.
|
|
211
219
|
* Used when the highlight is controlled.
|
|
@@ -249,6 +257,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
249
257
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
250
258
|
*/
|
|
251
259
|
onHighlightChange: PropTypes.func,
|
|
260
|
+
/**
|
|
261
|
+
* The function called when the pointer position corresponds to a new axis data item.
|
|
262
|
+
* This update can either be caused by a pointer movement, or an axis update.
|
|
263
|
+
* In case of multiple axes, the function is called if at least one axis is updated.
|
|
264
|
+
* The argument contains the identifier for all axes with a `data` property.
|
|
265
|
+
* @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
|
|
266
|
+
*/
|
|
267
|
+
onHighlightedAxisChange: PropTypes.func,
|
|
252
268
|
/**
|
|
253
269
|
* Callback fired when clicking close to an item.
|
|
254
270
|
* This is only available for scatter plot for now.
|
package/esm/hooks/useAxis.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaul
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function useXAxes(): {
|
|
13
13
|
xAxis: import("../internals/index.js").ComputedAxisConfig<import("../index.js").ChartsXAxisProps>;
|
|
14
|
-
xAxisIds:
|
|
14
|
+
xAxisIds: AxisId[];
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Get all the y-axes.
|
|
@@ -25,7 +25,7 @@ export declare function useXAxes(): {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function useYAxes(): {
|
|
27
27
|
yAxis: import("../internals/index.js").ComputedAxisConfig<import("../index.js").ChartsYAxisProps>;
|
|
28
|
-
yAxisIds:
|
|
28
|
+
yAxisIds: AxisId[];
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Get the X axis.
|
package/esm/hooks/useTicks.d.ts
CHANGED
|
@@ -49,8 +49,13 @@ export type TickItemType = {
|
|
|
49
49
|
offset: number;
|
|
50
50
|
labelOffset: number;
|
|
51
51
|
};
|
|
52
|
+
export declare function getTicks(options: {
|
|
53
|
+
scale: D3Scale;
|
|
54
|
+
valueFormatter?: AxisConfig['valueFormatter'];
|
|
55
|
+
isInside: (offset: number) => boolean;
|
|
56
|
+
} & Pick<TickParams, 'tickInterval' | 'tickPlacement' | 'tickLabelPlacement'> & Required<Pick<TickParams, 'tickNumber'>>): TickItemType[];
|
|
52
57
|
export declare function useTicks(options: {
|
|
53
58
|
scale: D3Scale;
|
|
54
59
|
valueFormatter?: AxisConfig['valueFormatter'];
|
|
55
60
|
direction: 'x' | 'y';
|
|
56
|
-
} & Pick<TickParams, '
|
|
61
|
+
} & Pick<TickParams, 'tickInterval' | 'tickPlacement' | 'tickLabelPlacement'> & Required<Pick<TickParams, 'tickNumber'>>): TickItemType[];
|
package/esm/hooks/useTicks.js
CHANGED
|
@@ -10,7 +10,7 @@ const offsetRatio = {
|
|
|
10
10
|
end: 1,
|
|
11
11
|
middle: 0.5
|
|
12
12
|
};
|
|
13
|
-
export function
|
|
13
|
+
export function getTicks(options) {
|
|
14
14
|
const {
|
|
15
15
|
scale,
|
|
16
16
|
tickNumber,
|
|
@@ -18,75 +18,111 @@ export function useTicks(options) {
|
|
|
18
18
|
tickInterval,
|
|
19
19
|
tickPlacement = 'extremities',
|
|
20
20
|
tickLabelPlacement: tickLabelPlacementProp,
|
|
21
|
-
|
|
21
|
+
isInside
|
|
22
22
|
} = options;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return [...filteredDomain.map(value => ({
|
|
23
|
+
|
|
24
|
+
// band scale
|
|
25
|
+
if (isBandScale(scale)) {
|
|
26
|
+
const domain = scale.domain();
|
|
27
|
+
const tickLabelPlacement = tickLabelPlacementProp ?? 'middle';
|
|
28
|
+
if (scale.bandwidth() > 0) {
|
|
29
|
+
// scale type = 'band'
|
|
30
|
+
const filteredDomain = typeof tickInterval === 'function' && domain.filter(tickInterval) || typeof tickInterval === 'object' && tickInterval || domain;
|
|
31
|
+
return [...filteredDomain.map(value => {
|
|
32
|
+
const defaultTickLabel = `${value}`;
|
|
33
|
+
return {
|
|
35
34
|
value,
|
|
36
35
|
formattedValue: valueFormatter?.(value, {
|
|
37
36
|
location: 'tick',
|
|
38
|
-
scale
|
|
39
|
-
|
|
37
|
+
scale,
|
|
38
|
+
tickNumber,
|
|
39
|
+
defaultTickLabel
|
|
40
|
+
}) ?? defaultTickLabel,
|
|
40
41
|
offset: scale(value) - (scale.step() - scale.bandwidth()) / 2 + offsetRatio[tickPlacement] * scale.step(),
|
|
41
42
|
labelOffset: tickLabelPlacement === 'tick' ? 0 : scale.step() * (offsetRatio[tickLabelPlacement] - offsetRatio[tickPlacement])
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
43
|
+
};
|
|
44
|
+
}), ...(tickPlacement === 'extremities' ? [{
|
|
45
|
+
formattedValue: undefined,
|
|
46
|
+
offset: scale.range()[1],
|
|
47
|
+
labelOffset: 0
|
|
48
|
+
}] : [])];
|
|
49
|
+
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// scale type = 'point'
|
|
52
|
+
const filteredDomain = typeof tickInterval === 'function' && domain.filter(tickInterval) || typeof tickInterval === 'object' && tickInterval || domain;
|
|
53
|
+
return filteredDomain.map(value => {
|
|
54
|
+
const defaultTickLabel = `${value}`;
|
|
55
|
+
return {
|
|
52
56
|
value,
|
|
53
57
|
formattedValue: valueFormatter?.(value, {
|
|
54
58
|
location: 'tick',
|
|
55
|
-
scale
|
|
56
|
-
|
|
59
|
+
scale,
|
|
60
|
+
tickNumber,
|
|
61
|
+
defaultTickLabel
|
|
62
|
+
}) ?? defaultTickLabel,
|
|
57
63
|
offset: scale(value),
|
|
58
64
|
labelOffset: 0
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const domain = scale.domain();
|
|
69
|
+
// Skip axis rendering if no data is available
|
|
70
|
+
// - The domains contains Infinity for continuous scales.
|
|
71
|
+
if (domain.some(isInfinity)) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
const tickLabelPlacement = tickLabelPlacementProp;
|
|
75
|
+
const ticks = typeof tickInterval === 'object' ? tickInterval : scale.ticks(tickNumber);
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
// Ticks inside the drawing area
|
|
78
|
+
const visibleTicks = [];
|
|
79
|
+
for (let i = 0; i < ticks.length; i += 1) {
|
|
80
|
+
const value = ticks[i];
|
|
81
|
+
const offset = scale(value);
|
|
82
|
+
if (isInside(offset)) {
|
|
83
|
+
/* If d3 returns an empty string, it means that a tick should be shown, but its label shouldn't.
|
|
84
|
+
* This is especially useful in a log scale where we want to show ticks to demonstrate it's a log
|
|
85
|
+
* scale, but don't want to show labels because they would overlap.
|
|
86
|
+
* https://github.com/mui/mui-x/issues/18239 */
|
|
87
|
+
const defaultTickLabel = scale.tickFormat(tickNumber)(value);
|
|
88
|
+
visibleTicks.push({
|
|
89
|
+
value,
|
|
90
|
+
formattedValue: valueFormatter?.(value, {
|
|
91
|
+
location: 'tick',
|
|
92
|
+
scale,
|
|
93
|
+
tickNumber,
|
|
94
|
+
defaultTickLabel
|
|
95
|
+
}) ?? defaultTickLabel,
|
|
96
|
+
offset,
|
|
97
|
+
// Allowing the label to be placed in the middle of a continuous scale is weird.
|
|
98
|
+
// But it is useful in some cases, like funnel categories with a linear scale.
|
|
99
|
+
labelOffset: tickLabelPlacement === 'middle' ? scale(ticks[i - 1] ?? 0) - (offset + scale(ticks[i - 1] ?? 0)) / 2 : 0
|
|
100
|
+
});
|
|
89
101
|
}
|
|
90
|
-
|
|
91
|
-
|
|
102
|
+
}
|
|
103
|
+
return visibleTicks;
|
|
104
|
+
}
|
|
105
|
+
export function useTicks(options) {
|
|
106
|
+
const {
|
|
107
|
+
scale,
|
|
108
|
+
tickNumber,
|
|
109
|
+
valueFormatter,
|
|
110
|
+
tickInterval,
|
|
111
|
+
tickPlacement = 'extremities',
|
|
112
|
+
tickLabelPlacement,
|
|
113
|
+
direction
|
|
114
|
+
} = options;
|
|
115
|
+
const {
|
|
116
|
+
instance
|
|
117
|
+
} = useChartContext();
|
|
118
|
+
const isInside = direction === 'x' ? instance.isXInside : instance.isYInside;
|
|
119
|
+
return React.useMemo(() => getTicks({
|
|
120
|
+
scale,
|
|
121
|
+
tickNumber,
|
|
122
|
+
tickPlacement,
|
|
123
|
+
tickInterval,
|
|
124
|
+
tickLabelPlacement,
|
|
125
|
+
valueFormatter,
|
|
126
|
+
isInside
|
|
127
|
+
}), [scale, tickNumber, tickPlacement, tickInterval, tickLabelPlacement, valueFormatter, isInside]);
|
|
92
128
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ZoomSliderShowTooltip } from "./plugins/featurePlugins/useChartCartesianAxis/zoom.types.js";
|
|
2
2
|
/** Margin in the opposite direction of the axis, i.e., horizontal if the axis is vertical and vice versa. */
|
|
3
3
|
export declare const ZOOM_SLIDER_MARGIN = 4;
|
|
4
|
+
/** Size of the zoom slider preview. */
|
|
5
|
+
export declare const ZOOM_SLIDER_PREVIEW_SIZE = 40;
|
|
4
6
|
/** Size reserved for the zoom slider. The actual size of the slider might be smaller. */
|
|
5
7
|
export declare const DEFAULT_ZOOM_SLIDER_SIZE: number;
|
|
8
|
+
export declare const DEFAULT_ZOOM_SLIDER_PREVIEW_SIZE: number;
|
|
6
9
|
export declare const DEFAULT_ZOOM_SLIDER_SHOW_TOOLTIP: ZoomSliderShowTooltip;
|
|
7
10
|
/** Default margin for pie charts. */
|
|
8
11
|
export declare const DEFAULT_PIE_CHART_MARGIN: {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/** Margin in the opposite direction of the axis, i.e., horizontal if the axis is vertical and vice versa. */
|
|
2
2
|
export const ZOOM_SLIDER_MARGIN = 4;
|
|
3
3
|
|
|
4
|
+
/** Size of the zoom slider preview. */
|
|
5
|
+
export const ZOOM_SLIDER_PREVIEW_SIZE = 40;
|
|
6
|
+
|
|
4
7
|
/** Size reserved for the zoom slider. The actual size of the slider might be smaller. */
|
|
5
8
|
export const DEFAULT_ZOOM_SLIDER_SIZE = 20 + 2 * ZOOM_SLIDER_MARGIN;
|
|
9
|
+
export const DEFAULT_ZOOM_SLIDER_PREVIEW_SIZE = 40 + 2 * ZOOM_SLIDER_MARGIN;
|
|
6
10
|
export const DEFAULT_ZOOM_SLIDER_SHOW_TOOLTIP = 'hover';
|
|
7
11
|
|
|
8
12
|
/** Default margin for pie charts. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getLabel<Location extends string>(value: string | ((location: Location) => string) | undefined, location: Location): string | undefined;
|
|
1
|
+
export declare function getLabel<Location extends string>(value: string | ((location: Location) => string | undefined) | undefined, location: Location): string | undefined;
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
|
7
7
|
export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
8
8
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
9
9
|
export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
|
|
10
|
+
export { seriesConfig as scatterSeriesConfig } from "../ScatterChart/seriesConfig/index.js";
|
|
10
11
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
11
12
|
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
12
13
|
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
|
10
10
|
export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
11
11
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
12
12
|
export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
|
|
13
|
+
export { seriesConfig as scatterSeriesConfig } from "../ScatterChart/seriesConfig/index.js";
|
|
13
14
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
14
15
|
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
15
16
|
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type UseChartAnimationSignature } from "./useChartAnimation/index.js";
|
|
2
2
|
import { type UseChartDimensionsSignature } from "./useChartDimensions/index.js";
|
|
3
|
+
import { type UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature/index.js";
|
|
3
4
|
import { type UseChartIdSignature, UseChartIdParameters } from "./useChartId/index.js";
|
|
4
5
|
import { type UseChartSeriesSignature } from "./useChartSeries/index.js";
|
|
5
6
|
import { type UseChartInteractionListenerSignature } from "./useChartInteractionListener/index.js";
|
|
@@ -7,6 +8,6 @@ import { type UseChartInteractionListenerSignature } from "./useChartInteraction
|
|
|
7
8
|
* Internal plugins that create the tools used by the other plugins.
|
|
8
9
|
* These plugins are used by the Charts components.
|
|
9
10
|
*/
|
|
10
|
-
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartInteractionListenerSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
11
|
-
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature, UseChartInteractionListenerSignature];
|
|
11
|
+
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartExperimentalFeaturesSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartInteractionListenerSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
12
|
+
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartExperimentalFeaturesSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature, UseChartInteractionListenerSignature];
|
|
12
13
|
export interface ChartCorePluginParameters extends UseChartIdParameters {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useChartAnimation } from "./useChartAnimation/index.js";
|
|
2
2
|
import { useChartDimensions } from "./useChartDimensions/index.js";
|
|
3
|
+
import { useChartExperimentalFeatures } from "./useChartExperimentalFeature/index.js";
|
|
3
4
|
import { useChartId } from "./useChartId/index.js";
|
|
4
5
|
import { useChartSeries } from "./useChartSeries/index.js";
|
|
5
6
|
import { useChartInteractionListener } from "./useChartInteractionListener/index.js";
|
|
@@ -8,4 +9,4 @@ import { useChartInteractionListener } from "./useChartInteractionListener/index
|
|
|
8
9
|
* Internal plugins that create the tools used by the other plugins.
|
|
9
10
|
* These plugins are used by the Charts components.
|
|
10
11
|
*/
|
|
11
|
-
export const CHART_CORE_PLUGINS = [useChartId, useChartDimensions, useChartSeries, useChartInteractionListener, useChartAnimation];
|
|
12
|
+
export const CHART_CORE_PLUGINS = [useChartId, useChartExperimentalFeatures, useChartDimensions, useChartSeries, useChartInteractionListener, useChartAnimation];
|
package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { UseChartDimensionsSignature } from "./useChartDimensions.types.js"
|
|
|
3
3
|
import { ChartState } from "../../models/chart.js";
|
|
4
4
|
export declare const selectorChartDimensionsState: ChartRootSelector<UseChartDimensionsSignature>;
|
|
5
5
|
export declare const selectorChartMargin: (state: ChartState<[UseChartDimensionsSignature]>) => import("./useChartDimensions.types.js").ChartMargin;
|
|
6
|
-
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & Partial<import("../../../index.js").UseChartCartesianAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -15,7 +15,7 @@ export declare const selectorChartDrawingArea: import("reselect").Selector<impor
|
|
|
15
15
|
top: number;
|
|
16
16
|
bottom: number;
|
|
17
17
|
}, []>;
|
|
18
|
-
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
18
|
+
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
20
|
} & {
|
|
21
21
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -23,7 +23,7 @@ export declare const selectorChartPropsSize: import("reselect").Selector<import(
|
|
|
23
23
|
width: number | undefined;
|
|
24
24
|
height: number | undefined;
|
|
25
25
|
}, any[]>;
|
|
26
|
-
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
26
|
+
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
28
|
} & {
|
|
29
29
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useChartExperimentalFeatures } from "./useChartExperimentalFeature.js";
|
|
2
|
+
export type { UseChartExperimentalFeaturesSignature, UseChartExperimentalFeaturesParameters } from "./useChartExperimentalFeature.types.js";
|
|
3
|
+
export * from "./useChartExperimentalFeature.selectors.js";
|
package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
|
+
export const useChartExperimentalFeatures = ({
|
|
6
|
+
params,
|
|
7
|
+
store
|
|
8
|
+
}) => {
|
|
9
|
+
useEnhancedEffect(() => {
|
|
10
|
+
store.update(prevState => {
|
|
11
|
+
return _extends({}, prevState, {
|
|
12
|
+
experimentalFeatures: params.experimentalFeatures
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}, [store, params.experimentalFeatures]);
|
|
16
|
+
return {};
|
|
17
|
+
};
|
|
18
|
+
useChartExperimentalFeatures.params = {
|
|
19
|
+
experimentalFeatures: true
|
|
20
|
+
};
|
|
21
|
+
useChartExperimentalFeatures.getInitialState = ({
|
|
22
|
+
experimentalFeatures
|
|
23
|
+
}) => {
|
|
24
|
+
return {
|
|
25
|
+
experimentalFeatures
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartRootSelector } from "../../utils/selectors.js";
|
|
2
|
+
import type { UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.js";
|
|
3
|
+
export declare const selectorChartExperimentalFeaturesState: ChartRootSelector<UseChartExperimentalFeaturesSignature>;
|
|
4
|
+
export declare const selectorPreferStrictDomainInLineCharts: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
|
+
} & {
|
|
7
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
|
+
}, boolean, any[]>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
2
|
+
export const selectorChartExperimentalFeaturesState = state => state.experimentalFeatures;
|
|
3
|
+
export const selectorPreferStrictDomainInLineCharts = createSelector([selectorChartExperimentalFeaturesState], features => Boolean(features?.preferStrictDomainInLineCharts));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
+
export interface ChartExperimentalFeatures {
|
|
3
|
+
/**
|
|
4
|
+
* Default domainLimit to strict for line chart x-axis.
|
|
5
|
+
*/
|
|
6
|
+
preferStrictDomainInLineCharts?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UseChartExperimentalFeaturesParameters {
|
|
9
|
+
/**
|
|
10
|
+
* Options to enable features planned for the next major.
|
|
11
|
+
*/
|
|
12
|
+
experimentalFeatures?: ChartExperimentalFeatures;
|
|
13
|
+
}
|
|
14
|
+
export interface UseChartExperimentalFeaturesState {
|
|
15
|
+
experimentalFeatures?: ChartExperimentalFeatures;
|
|
16
|
+
}
|
|
17
|
+
export type UseChartExperimentalFeaturesSignature = ChartPluginSignature<{
|
|
18
|
+
params: UseChartExperimentalFeaturesParameters;
|
|
19
|
+
defaultizedParams: UseChartExperimentalFeaturesParameters;
|
|
20
|
+
state: UseChartExperimentalFeaturesState;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param {ChartState<[UseChartIdSignature]>} state The state of the chart.
|
|
4
4
|
* @returns {string} The id attribute of the chart.
|
|
5
5
|
*/
|
|
6
|
-
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChartRootSelector } from "../../utils/selectors.js";
|
|
2
2
|
import { UseChartSeriesSignature } from "./useChartSeries.types.js";
|
|
3
3
|
export declare const selectorChartSeriesState: ChartRootSelector<UseChartSeriesSignature>;
|
|
4
|
-
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
4
|
+
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
} & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
}, import("./useChartSeries.types.js").ProcessedSeries<keyof import("../../../index.js").ChartsSeriesConfig>, any[]>;
|
|
9
|
-
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
9
|
+
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
} & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|