@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,21 +1,20 @@
|
|
|
1
|
-
import { AxisId } from "../../../../models/axis.js";
|
|
2
|
-
import
|
|
3
|
-
export declare const selectorChartsInteractionRotationAxisIndex: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
1
|
+
import { AxisId, AxisItemIdentifier } from "../../../../models/axis.js";
|
|
2
|
+
export declare const selectorChartsInteractionRotationAxisIndex: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
4
3
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
4
|
} & {
|
|
6
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
7
6
|
} & Partial<{}> & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState> & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState>, number | null, [id?: AxisId | undefined]>;
|
|
8
|
-
export declare const selectorChartsInteractionRotationAxisIndexes: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
7
|
+
export declare const selectorChartsInteractionRotationAxisIndexes: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
9
8
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
9
|
} & {
|
|
11
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
12
11
|
} & Partial<{}> & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState> & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState>, number[] | null, [ids: AxisId[]]>;
|
|
13
|
-
export declare const selectorChartsInteractionRotationAxisValue: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
12
|
+
export declare const selectorChartsInteractionRotationAxisValue: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
14
13
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
14
|
} & {
|
|
16
15
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
17
16
|
} & Partial<{}> & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState> & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState>, any, [id?: AxisId | undefined]>;
|
|
18
|
-
export declare const selectorChartsInteractionRotationAxisValues: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
17
|
+
export declare const selectorChartsInteractionRotationAxisValues: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
19
18
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
19
|
} & {
|
|
21
20
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -23,7 +22,7 @@ export declare const selectorChartsInteractionRotationAxisValues: import("resele
|
|
|
23
22
|
/**
|
|
24
23
|
* Get rotation-axis ids and corresponding data index that should be display in the tooltip.
|
|
25
24
|
*/
|
|
26
|
-
export declare const selectorChartsInteractionTooltipRotationAxes: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
25
|
+
export declare const selectorChartsInteractionTooltipRotationAxes: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
27
26
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
27
|
} & {
|
|
29
28
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -35,7 +34,7 @@ export declare const selectorChartsInteractionTooltipRadiusAxes: import("reselec
|
|
|
35
34
|
/**
|
|
36
35
|
* Return `true` if the axis tooltip has something to display.
|
|
37
36
|
*/
|
|
38
|
-
export declare const selectorChartsInteractionPolarAxisTooltip: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
37
|
+
export declare const selectorChartsInteractionPolarAxisTooltip: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
39
38
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
40
39
|
} & {
|
|
41
40
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartStore } from "./ChartStore.js";
|
|
2
|
+
import { ChartAnyPluginSignature, ChartState } from "../models/index.js";
|
|
3
|
+
export declare function useLazySelectorEffect<TSignatures extends readonly ChartAnyPluginSignature[], Value>(store: ChartStore<TSignatures>, selector: (state: ChartState<TSignatures>) => Value, effect: (previous: Value, next: Value) => void,
|
|
4
|
+
/**
|
|
5
|
+
* If true, the selector will be ignored.
|
|
6
|
+
*/
|
|
7
|
+
skip?: boolean): void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable react-compiler/react-compiler */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import useLazyRef from '@mui/utils/useLazyRef';
|
|
6
|
+
const noop = () => {};
|
|
7
|
+
export function useLazySelectorEffect(store, selector, effect,
|
|
8
|
+
/**
|
|
9
|
+
* If true, the selector will be ignored.
|
|
10
|
+
*/
|
|
11
|
+
skip) {
|
|
12
|
+
const instance = useLazyRef(initialize, {
|
|
13
|
+
store,
|
|
14
|
+
selector,
|
|
15
|
+
skip
|
|
16
|
+
}).current;
|
|
17
|
+
instance.effect = effect;
|
|
18
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
+
React.useEffect(instance.onMount(skip), [skip]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// `useLazyRef` typings are incorrect, `params` should not be optional
|
|
23
|
+
function initialize(params) {
|
|
24
|
+
const {
|
|
25
|
+
store,
|
|
26
|
+
selector,
|
|
27
|
+
skip: initialSkip
|
|
28
|
+
} = params;
|
|
29
|
+
let isRunning = false;
|
|
30
|
+
let previousState;
|
|
31
|
+
|
|
32
|
+
// We want a single subscription done right away and cleared on unmount only,
|
|
33
|
+
// but React triggers `useOnMount` multiple times in dev, so we need to manage
|
|
34
|
+
// the subscription anyway.
|
|
35
|
+
const subscribe = () => {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
37
|
+
instance.dispose ??= store.subscribe(state => {
|
|
38
|
+
const nextState = selector(state);
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
40
|
+
instance.effect(previousState, nextState);
|
|
41
|
+
previousState = nextState;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const instance = {
|
|
45
|
+
effect: noop,
|
|
46
|
+
dispose: null,
|
|
47
|
+
onMount: skip => () => {
|
|
48
|
+
if (skip) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
if (!isRunning) {
|
|
52
|
+
// Initialize values
|
|
53
|
+
isRunning = true;
|
|
54
|
+
previousState = selector(store.value);
|
|
55
|
+
}
|
|
56
|
+
subscribe();
|
|
57
|
+
return () => {
|
|
58
|
+
instance.dispose?.();
|
|
59
|
+
instance.dispose = null;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
if (!initialSkip) {
|
|
64
|
+
// Initialize values
|
|
65
|
+
isRunning = true;
|
|
66
|
+
previousState = selector(store.value);
|
|
67
|
+
subscribe();
|
|
68
|
+
}
|
|
69
|
+
return instance;
|
|
70
|
+
}
|
|
@@ -16,7 +16,7 @@ import { ChartSeriesConfig } from "../plugins/models/seriesConfig/index.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function useCharts<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(inPlugins: ConvertSignaturesIntoPlugins<TSignatures>, props: Partial<UseChartBaseProps<TSignatures>>, seriesConfig: ChartSeriesConfig<TSeriesType>): {
|
|
18
18
|
contextValue: {
|
|
19
|
-
store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]> & UseChartInteractionState;
|
|
19
|
+
store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../plugins/corePlugins/useChartExperimentalFeature/index.js").UseChartExperimentalFeaturesSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]> & UseChartInteractionState;
|
|
20
20
|
publicAPI: ChartPublicAPI<TSignatures>;
|
|
21
21
|
instance: ChartInstance<TSignatures>;
|
|
22
22
|
svgRef: React.RefObject<SVGSVGElement | null>;
|
package/esm/models/axis.d.ts
CHANGED
|
@@ -281,11 +281,37 @@ export type AxisValueFormatterContext<S extends ScaleName = ScaleName> = {
|
|
|
281
281
|
* - `'legend'` The value is displayed in the legend when using color legend.
|
|
282
282
|
* - `'zoom-slider-tooltip'` The value is displayed in the zoom slider tooltip.
|
|
283
283
|
*/
|
|
284
|
-
location: '
|
|
284
|
+
location: 'tooltip' | 'zoom-slider-tooltip';
|
|
285
285
|
/**
|
|
286
286
|
* The d3-scale instance associated to the axis.
|
|
287
287
|
*/
|
|
288
288
|
scale: AxisScaleConfig[S]['scale'];
|
|
289
|
+
} | {
|
|
290
|
+
/**
|
|
291
|
+
* Location indicates where the value will be displayed.
|
|
292
|
+
* - `'tick'` The value is displayed on the axis ticks.
|
|
293
|
+
* - `'tooltip'` The value is displayed in the tooltip when hovering the chart.
|
|
294
|
+
* - `'legend'` The value is displayed in the legend when using color legend.
|
|
295
|
+
* - `'zoom-slider-tooltip'` The value is displayed in the zoom slider tooltip.
|
|
296
|
+
*/
|
|
297
|
+
location: 'tick';
|
|
298
|
+
/**
|
|
299
|
+
* The d3-scale instance associated to the axis.
|
|
300
|
+
*/
|
|
301
|
+
scale: AxisScaleConfig[S]['scale'];
|
|
302
|
+
/**
|
|
303
|
+
* The tick label shown by default if the value isn't formatted.
|
|
304
|
+
* This value might be an empty string if no tick label should be displayed, which is particularly useful in log
|
|
305
|
+
* scales where we want to show ticks to demonstrate it's a log scale, but not labels to avoid them overlapping.
|
|
306
|
+
* @see See {@link https://d3js.org/d3-scale/log#log_tickFormat D3 log scale docs} for more details.
|
|
307
|
+
*/
|
|
308
|
+
defaultTickLabel: string;
|
|
309
|
+
/**
|
|
310
|
+
* A suggestion of the number of ticks to show.
|
|
311
|
+
* Can be provided to the scale's `ticks` method to compute the ticks, or to `tickFormat` to format the ticks.
|
|
312
|
+
* Can be `undefined` if the scale doesn't support it, e.g., band, point scales.
|
|
313
|
+
*/
|
|
314
|
+
tickNumber?: number;
|
|
289
315
|
};
|
|
290
316
|
/**
|
|
291
317
|
* Config that is shared between cartesian and polar axes.
|
|
@@ -408,6 +434,21 @@ export interface ChartsAxisData {
|
|
|
408
434
|
*/
|
|
409
435
|
seriesValues: Record<string, number | null | undefined>;
|
|
410
436
|
}
|
|
437
|
+
export type CartesianDirection = 'x' | 'y';
|
|
438
|
+
export type PolarDirection = 'rotation' | 'radius';
|
|
439
|
+
/**
|
|
440
|
+
* Identifies a data point within an axis.
|
|
441
|
+
*/
|
|
442
|
+
export interface AxisItemIdentifier {
|
|
443
|
+
/**
|
|
444
|
+
* The axis id.
|
|
445
|
+
*/
|
|
446
|
+
axisId: AxisId;
|
|
447
|
+
/**
|
|
448
|
+
* The data index.
|
|
449
|
+
*/
|
|
450
|
+
dataIndex: number;
|
|
451
|
+
}
|
|
411
452
|
export type XAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsXAxisProps>, 'id'> : never;
|
|
412
453
|
export type YAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsYAxisProps>, 'id'> : never;
|
|
413
454
|
export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? AxisConfig<S, V, ChartsRotationAxisProps> : never;
|
package/esm/models/axis.js
CHANGED
package/esm/models/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./seriesType/index.js";
|
|
2
2
|
export * from "./stacking.js";
|
|
3
3
|
export * from "./slots/index.js";
|
|
4
|
-
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisValueFormatterContext } from "./axis.js";
|
|
4
|
+
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisItemIdentifier, AxisValueFormatterContext } from "./axis.js";
|
|
5
5
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
|
6
6
|
export type { Position } from "./position.js";
|
|
7
7
|
export type { CurveType } from "./curve.js";
|
|
@@ -25,6 +25,16 @@ export interface BarSeriesType extends CommonSeriesType<number | null>, Cartesia
|
|
|
25
25
|
* @default 'diverging'
|
|
26
26
|
*/
|
|
27
27
|
stackOffset?: StackOffsetType;
|
|
28
|
+
/**
|
|
29
|
+
* If provided, the value will be used as the minimum size of the bar in pixels.
|
|
30
|
+
* This is useful to avoid bars with a size of 0.
|
|
31
|
+
*
|
|
32
|
+
* The property is ignored if the series value is `null` or `0`.
|
|
33
|
+
* It also doesn't work with stacked series.
|
|
34
|
+
*
|
|
35
|
+
* @default 0px
|
|
36
|
+
*/
|
|
37
|
+
minBarSize?: number;
|
|
28
38
|
}
|
|
29
39
|
/**
|
|
30
40
|
* An object that allows to identify a single bar.
|
|
@@ -35,4 +45,4 @@ export type BarItemIdentifier = {
|
|
|
35
45
|
seriesId: SeriesId;
|
|
36
46
|
dataIndex: number;
|
|
37
47
|
};
|
|
38
|
-
export interface DefaultizedBarSeriesType extends DefaultizedProps<BarSeriesType, CommonDefaultizedProps | 'color' | 'layout'> {}
|
|
48
|
+
export interface DefaultizedBarSeriesType extends DefaultizedProps<BarSeriesType, CommonDefaultizedProps | 'color' | 'layout' | 'minBarSize'> {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ChartsLabelMarkProps } from "../../ChartsLabel/index.js";
|
|
2
1
|
import { HighlightScope } from "../../internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.js";
|
|
3
2
|
import type { StackOffsetType, StackOrderType } from "../stacking.js";
|
|
3
|
+
import type { ChartsLabelMarkType } from "../../ChartsLabel/ChartsLabelMark.js";
|
|
4
4
|
export type SeriesId = number | string;
|
|
5
5
|
export type SeriesValueFormatterContext = {
|
|
6
6
|
/**
|
|
@@ -10,7 +10,13 @@ export type SeriesValueFormatterContext = {
|
|
|
10
10
|
};
|
|
11
11
|
export type SeriesValueFormatter<TValue> = (value: TValue, context: SeriesValueFormatterContext) => string | null;
|
|
12
12
|
export type CommonSeriesType<TValue> = {
|
|
13
|
+
/**
|
|
14
|
+
* The id of this series.
|
|
15
|
+
*/
|
|
13
16
|
id?: SeriesId;
|
|
17
|
+
/**
|
|
18
|
+
* Color to use when displaying the series.
|
|
19
|
+
*/
|
|
14
20
|
color?: string;
|
|
15
21
|
/**
|
|
16
22
|
* Formatter used to render values in tooltip or other data display.
|
|
@@ -22,13 +28,13 @@ export type CommonSeriesType<TValue> = {
|
|
|
22
28
|
/**
|
|
23
29
|
* The scope to apply when the series is highlighted.
|
|
24
30
|
*/
|
|
25
|
-
highlightScope?:
|
|
31
|
+
highlightScope?: HighlightScope;
|
|
26
32
|
/**
|
|
27
33
|
* Defines the mark type for the series.
|
|
28
34
|
*
|
|
29
35
|
* There is a default mark type for each series type.
|
|
30
36
|
*/
|
|
31
|
-
labelMarkType?:
|
|
37
|
+
labelMarkType?: ChartsLabelMarkType;
|
|
32
38
|
};
|
|
33
39
|
export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
|
|
34
40
|
export type CartesianSeriesType = {
|
|
@@ -34,7 +34,9 @@ export interface LineSeriesType extends CommonSeriesType<number | null>, Cartesi
|
|
|
34
34
|
* The key used to retrieve data from the dataset.
|
|
35
35
|
*/
|
|
36
36
|
dataKey?: string;
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, the series is rendered as an area instead of a line.
|
|
39
|
+
*/
|
|
38
40
|
area?: boolean;
|
|
39
41
|
/**
|
|
40
42
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
1
|
+
import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
2
2
|
import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId } from "./common.js";
|
|
3
3
|
export type ScatterValueType = {
|
|
4
4
|
x: number;
|
|
@@ -12,6 +12,9 @@ export type ScatterValueType = {
|
|
|
12
12
|
export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null>, CartesianSeriesType {
|
|
13
13
|
type: 'scatter';
|
|
14
14
|
data?: readonly ScatterValueType[];
|
|
15
|
+
/**
|
|
16
|
+
* Size of the markers in the scatter plot, in pixels.
|
|
17
|
+
*/
|
|
15
18
|
markerSize?: number;
|
|
16
19
|
/**
|
|
17
20
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
@@ -50,6 +53,13 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
|
|
|
50
53
|
*/
|
|
51
54
|
id?: string;
|
|
52
55
|
};
|
|
56
|
+
preview?: {
|
|
57
|
+
/**
|
|
58
|
+
* The size of the preview marker in pixels.
|
|
59
|
+
* @default 1
|
|
60
|
+
*/
|
|
61
|
+
markerSize?: number;
|
|
62
|
+
};
|
|
53
63
|
}
|
|
54
64
|
/**
|
|
55
65
|
* An object that allows to identify a single scatter item.
|
|
@@ -60,4 +70,6 @@ export type ScatterItemIdentifier = {
|
|
|
60
70
|
seriesId: SeriesId;
|
|
61
71
|
dataIndex: number;
|
|
62
72
|
};
|
|
63
|
-
export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps | 'color' | 'markerSize'> {
|
|
73
|
+
export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps | 'color' | 'markerSize'> {
|
|
74
|
+
preview: MakeRequired<NonNullable<ScatterSeriesType['preview']>, 'markerSize'>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const renderSymbol = Symbol.for('render');
|
|
2
|
+
const connectedSymbol = Symbol.for('connected');
|
|
3
|
+
const contextSymbol = Symbol.for('context');
|
|
4
|
+
const propsSymbol = Symbol.for('props');
|
|
5
|
+
|
|
6
|
+
// This function creates a custom web component that wraps a React component.
|
|
7
|
+
// Adapted from https://github.com/bitovi/react-to-web-component/blob/b1372bfd7bc67fe49920db840f1ed9cf736b2724/packages/core/src/core.ts
|
|
8
|
+
export function reactToWebComponent(ReactComponent, options, renderer) {
|
|
9
|
+
class ReactWebComponent extends HTMLElement {
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this[connectedSymbol] = true;
|
|
16
|
+
this[contextSymbol] = void 0;
|
|
17
|
+
this[propsSymbol] = {};
|
|
18
|
+
this.container = void 0;
|
|
19
|
+
if (options.shadow) {
|
|
20
|
+
this.container = this.attachShadow({
|
|
21
|
+
mode: options.shadow
|
|
22
|
+
});
|
|
23
|
+
} else {
|
|
24
|
+
this.container = this;
|
|
25
|
+
}
|
|
26
|
+
this[propsSymbol].container = this.container;
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this[connectedSymbol] = true;
|
|
30
|
+
this[renderSymbol]();
|
|
31
|
+
}
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
this[connectedSymbol] = false;
|
|
34
|
+
if (this[contextSymbol]) {
|
|
35
|
+
renderer.unmount(this[contextSymbol]);
|
|
36
|
+
}
|
|
37
|
+
delete this[contextSymbol];
|
|
38
|
+
}
|
|
39
|
+
[renderSymbol]() {
|
|
40
|
+
if (!this[connectedSymbol]) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!this[contextSymbol]) {
|
|
44
|
+
this[contextSymbol] = renderer.mount(this.container, ReactComponent, this[propsSymbol]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return ReactWebComponent;
|
|
49
|
+
}
|
|
@@ -33,6 +33,9 @@ export interface ChartsComponents<Theme = unknown> {
|
|
|
33
33
|
defaultProps?: ComponentsProps['MuiChartsSurface'];
|
|
34
34
|
styleOverrides?: ComponentsOverrides<Theme>['MuiChartsSurface'];
|
|
35
35
|
};
|
|
36
|
+
MuiChartDataProvider?: {
|
|
37
|
+
defaultProps?: ComponentsProps['MuiChartDataProvider'];
|
|
38
|
+
};
|
|
36
39
|
MuiBarChart?: {
|
|
37
40
|
defaultProps?: ComponentsProps['MuiBarChart'];
|
|
38
41
|
};
|
|
@@ -9,6 +9,7 @@ import { ScatterChartProps } from "../ScatterChart/ScatterChart.js";
|
|
|
9
9
|
import { PieChartProps } from "../PieChart/PieChart.js";
|
|
10
10
|
import { ChartsXAxisProps, ChartsYAxisProps } from "../models/axis.js";
|
|
11
11
|
import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
|
|
12
|
+
import { ChartDataProviderProps } from "../ChartDataProvider/index.js";
|
|
12
13
|
export interface ChartsComponentsPropsList {
|
|
13
14
|
MuiChartsXAxis: ChartsXAxisProps;
|
|
14
15
|
MuiChartsYAxis: ChartsYAxisProps;
|
|
@@ -17,6 +18,7 @@ export interface ChartsComponentsPropsList {
|
|
|
17
18
|
MuiChartsLocalizationProvider: ChartsLocalizationProviderProps;
|
|
18
19
|
MuiChartsTooltip: ChartsTooltipProps;
|
|
19
20
|
MuiChartsSurface: ChartsSurfaceProps;
|
|
21
|
+
MuiChartDataProvider: ChartDataProviderProps;
|
|
20
22
|
MuiBarChart: BarChartProps;
|
|
21
23
|
MuiBarLabel: BarLabelProps;
|
|
22
24
|
MuiLineChart: LineChartProps;
|
package/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/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[];
|