@mui/x-charts 8.0.0-alpha.12 → 8.0.0-alpha.13
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 +1 -1
- package/BarChart/BarChart.js +14 -30
- package/BarChart/useBarChartProps.js +3 -18
- package/CHANGELOG.md +299 -0
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/ChartContainer.js +15 -7
- package/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/ChartDataProvider/ChartDataProvider.js +4 -3
- package/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/ChartsAxis/ChartsAxis.js +25 -87
- package/ChartsAxis/axisClasses.d.ts +5 -1
- package/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/ChartsLabel/ChartsLabelMark.js +15 -2
- package/ChartsLabel/index.d.ts +1 -1
- package/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.js +1 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +70 -57
- package/ChartsYAxis/ChartsYAxis.js +11 -15
- package/Gauge/Gauge.js +4 -3
- package/Gauge/GaugeContainer.js +7 -5
- package/LineChart/LineChart.d.ts +1 -1
- package/LineChart/LineChart.js +14 -30
- package/LineChart/useLineChartProps.js +2 -17
- package/PieChart/PieArcLabelPlot.js +1 -1
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.js +6 -4
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +14 -30
- package/ScatterChart/useScatterChartProps.js +2 -17
- package/SparkLineChart/SparkLineChart.d.ts +4 -8
- package/SparkLineChart/SparkLineChart.js +23 -21
- package/constants/index.d.ts +8 -1
- package/constants/index.js +13 -6
- package/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/context/PolarProvider/Polar.types.d.ts +3 -2
- package/esm/BarChart/BarChart.d.ts +1 -1
- package/esm/BarChart/BarChart.js +14 -30
- package/esm/BarChart/useBarChartProps.js +3 -18
- package/esm/ChartContainer/ChartContainer.d.ts +1 -1
- package/esm/ChartContainer/ChartContainer.js +15 -7
- package/esm/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +4 -3
- package/esm/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/esm/ChartsAxis/ChartsAxis.js +24 -86
- package/esm/ChartsAxis/axisClasses.d.ts +5 -1
- package/esm/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/esm/ChartsLabel/ChartsLabelMark.js +15 -2
- package/esm/ChartsLabel/index.d.ts +1 -1
- package/esm/ChartsLabel/index.js +0 -3
- package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.js +1 -1
- package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +70 -57
- package/esm/ChartsYAxis/ChartsYAxis.js +12 -16
- package/esm/Gauge/Gauge.js +4 -3
- package/esm/Gauge/GaugeContainer.js +7 -5
- package/esm/LineChart/LineChart.d.ts +1 -1
- package/esm/LineChart/LineChart.js +14 -30
- package/esm/LineChart/useLineChartProps.js +2 -17
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.d.ts +1 -1
- package/esm/PieChart/PieChart.js +6 -4
- package/esm/ScatterChart/ScatterChart.d.ts +1 -1
- package/esm/ScatterChart/ScatterChart.js +14 -30
- package/esm/ScatterChart/useScatterChartProps.js +2 -17
- package/esm/SparkLineChart/SparkLineChart.d.ts +4 -8
- package/esm/SparkLineChart/SparkLineChart.js +23 -21
- package/esm/constants/index.d.ts +8 -1
- package/esm/constants/index.js +12 -5
- package/esm/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/esm/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/esm/context/PolarProvider/Polar.types.d.ts +3 -2
- package/esm/hooks/useAxis.d.ts +2 -2
- package/esm/hooks/useAxis.js +1 -1
- package/esm/hooks/useSvgRef.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/defaultizeColor.d.ts +23 -23
- package/esm/internals/defaultizeMargin.d.ts +3 -0
- package/esm/internals/defaultizeMargin.js +15 -0
- package/esm/internals/domUtils.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +37 -9
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +15 -14
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
- package/{internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/{modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/esm/internals/plugins/models/plugin.d.ts +1 -1
- package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/esm/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/esm/internals/plugins/utils/selectors.d.ts +1 -0
- package/esm/internals/store/useCharts.js +0 -8
- package/esm/internals/store/useSelector.d.ts +1 -1
- package/esm/internals/store/useSelector.js +4 -1
- package/esm/internals/store/useStore.js +1 -1
- package/esm/models/axis.d.ts +56 -10
- package/esm/models/colorMapping.d.ts +1 -1
- package/esm/models/index.d.ts +0 -1
- package/esm/models/index.js +0 -1
- package/esm/models/seriesType/bar.d.ts +1 -1
- package/esm/models/seriesType/config.d.ts +1 -1
- package/esm/models/seriesType/line.d.ts +1 -1
- package/esm/models/seriesType/pie.d.ts +1 -1
- package/esm/models/seriesType/scatter.d.ts +1 -1
- package/esm/models/z-axis.d.ts +1 -1
- package/hooks/useAxis.d.ts +2 -2
- package/hooks/useAxis.js +5 -5
- package/hooks/useSvgRef.js +1 -1
- package/index.js +1 -1
- package/internals/defaultizeColor.d.ts +23 -23
- package/internals/defaultizeMargin.d.ts +3 -0
- package/internals/defaultizeMargin.js +22 -0
- package/internals/domUtils.js +1 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +51 -30
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +20 -19
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +39 -37
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +36 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +16 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +11 -0
- package/{modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.js → useChartCartesianAxisRendering.selectors.js} +10 -13
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -5
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/internals/plugins/models/plugin.d.ts +1 -1
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/internals/plugins/utils/selectors.d.ts +1 -0
- package/internals/store/useCharts.js +0 -8
- package/internals/store/useSelector.d.ts +1 -1
- package/internals/store/useSelector.js +5 -1
- package/internals/store/useStore.js +1 -1
- package/models/axis.d.ts +56 -10
- package/models/colorMapping.d.ts +1 -1
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -11
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/config.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +1 -1
- package/models/z-axis.d.ts +1 -1
- package/modern/BarChart/BarChart.d.ts +1 -1
- package/modern/BarChart/BarChart.js +14 -30
- package/modern/BarChart/useBarChartProps.js +3 -18
- package/modern/ChartContainer/ChartContainer.d.ts +1 -1
- package/modern/ChartContainer/ChartContainer.js +15 -7
- package/modern/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/modern/ChartDataProvider/ChartDataProvider.js +4 -3
- package/modern/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/modern/ChartsAxis/ChartsAxis.js +24 -86
- package/modern/ChartsAxis/axisClasses.d.ts +5 -1
- package/modern/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/modern/ChartsLabel/ChartsLabelMark.js +15 -2
- package/modern/ChartsLabel/index.d.ts +1 -1
- package/modern/ChartsLabel/index.js +0 -3
- package/modern/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/modern/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/modern/ChartsLabel/labelMarkClasses.js +1 -1
- package/modern/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/modern/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +70 -57
- package/modern/ChartsYAxis/ChartsYAxis.js +12 -16
- package/modern/Gauge/Gauge.js +4 -3
- package/modern/Gauge/GaugeContainer.js +7 -5
- package/modern/LineChart/LineChart.d.ts +1 -1
- package/modern/LineChart/LineChart.js +14 -30
- package/modern/LineChart/useLineChartProps.js +2 -17
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.d.ts +1 -1
- package/modern/PieChart/PieChart.js +6 -4
- package/modern/ScatterChart/ScatterChart.d.ts +1 -1
- package/modern/ScatterChart/ScatterChart.js +14 -30
- package/modern/ScatterChart/useScatterChartProps.js +2 -17
- package/modern/SparkLineChart/SparkLineChart.d.ts +4 -8
- package/modern/SparkLineChart/SparkLineChart.js +23 -21
- package/modern/constants/index.d.ts +8 -1
- package/modern/constants/index.js +12 -5
- package/modern/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/modern/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/modern/context/PolarProvider/Polar.types.d.ts +3 -2
- package/modern/hooks/useAxis.d.ts +2 -2
- package/modern/hooks/useAxis.js +1 -1
- package/modern/hooks/useSvgRef.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/defaultizeColor.d.ts +23 -23
- package/modern/internals/defaultizeMargin.d.ts +3 -0
- package/modern/internals/defaultizeMargin.js +15 -0
- package/modern/internals/domUtils.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/modern/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +37 -9
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +15 -14
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
- package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/modern/internals/plugins/models/plugin.d.ts +1 -1
- package/modern/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/modern/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/modern/internals/plugins/utils/selectors.d.ts +1 -0
- package/modern/internals/store/useCharts.js +0 -8
- package/modern/internals/store/useSelector.d.ts +1 -1
- package/modern/internals/store/useSelector.js +4 -1
- package/modern/internals/store/useStore.js +1 -1
- package/modern/models/axis.d.ts +56 -10
- package/modern/models/colorMapping.d.ts +1 -1
- package/modern/models/index.d.ts +0 -1
- package/modern/models/index.js +0 -1
- package/modern/models/seriesType/bar.d.ts +1 -1
- package/modern/models/seriesType/config.d.ts +1 -1
- package/modern/models/seriesType/line.d.ts +1 -1
- package/modern/models/seriesType/pie.d.ts +1 -1
- package/modern/models/seriesType/scatter.d.ts +1 -1
- package/modern/models/z-axis.d.ts +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/esm/internals/calculateMargins.d.ts +0 -7
- package/esm/internals/calculateMargins.js +0 -25
- package/esm/models/layout.d.ts +0 -18
- package/esm/models/layout.js +0 -1
- package/internals/calculateMargins.d.ts +0 -7
- package/internals/calculateMargins.js +0 -33
- package/models/layout.d.ts +0 -18
- package/models/layout.js +0 -5
- package/modern/internals/calculateMargins.d.ts +0 -7
- package/modern/internals/calculateMargins.js +0 -25
- package/modern/models/layout.d.ts +0 -18
- package/modern/models/layout.js +0 -1
|
@@ -7,7 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import { useThemeProps,
|
|
10
|
+
import { useThemeProps, styled } from '@mui/material/styles';
|
|
11
11
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
12
12
|
import { useTicks } from "../hooks/useTicks.js";
|
|
13
13
|
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
@@ -40,7 +40,6 @@ const YAxisRoot = styled(AxisRoot, {
|
|
|
40
40
|
overridesResolver: (props, styles) => styles.root
|
|
41
41
|
})({});
|
|
42
42
|
const defaultProps = {
|
|
43
|
-
position: 'left',
|
|
44
43
|
disableLine: false,
|
|
45
44
|
disableTicks: false,
|
|
46
45
|
tickSize: 6
|
|
@@ -86,13 +85,11 @@ function ChartsYAxis(inProps) {
|
|
|
86
85
|
tickLabelPlacement,
|
|
87
86
|
tickInterval,
|
|
88
87
|
tickLabelInterval,
|
|
89
|
-
sx
|
|
88
|
+
sx,
|
|
89
|
+
offset
|
|
90
90
|
} = defaultizedProps;
|
|
91
|
-
const theme = useTheme();
|
|
92
91
|
const isRtl = useRtl();
|
|
93
|
-
const classes = useUtilityClasses(
|
|
94
|
-
theme
|
|
95
|
-
}));
|
|
92
|
+
const classes = useUtilityClasses(defaultizedProps);
|
|
96
93
|
const {
|
|
97
94
|
instance
|
|
98
95
|
} = useChartContext();
|
|
@@ -158,14 +155,16 @@ function ChartsYAxis(inProps) {
|
|
|
158
155
|
});
|
|
159
156
|
const domain = yScale.domain();
|
|
160
157
|
const ordinalAxis = isBandScale(yScale);
|
|
158
|
+
|
|
161
159
|
// Skip axis rendering if no data is available
|
|
162
160
|
// - The domain is an empty array for band/point scales.
|
|
163
161
|
// - The domains contains Infinity for continuous scales.
|
|
164
|
-
|
|
162
|
+
// - The position is 'none'.
|
|
163
|
+
if (ordinalAxis && domain.length === 0 || !ordinalAxis && domain.some(isInfinity) || position === 'none') {
|
|
165
164
|
return null;
|
|
166
165
|
}
|
|
167
166
|
return /*#__PURE__*/_jsxs(YAxisRoot, {
|
|
168
|
-
transform: `translate(${position === 'right' ? left + width : left}, 0)`,
|
|
167
|
+
transform: `translate(${position === 'right' ? left + width + offset : left - offset}, 0)`,
|
|
169
168
|
className: classes.root,
|
|
170
169
|
sx: sx,
|
|
171
170
|
children: [!disableLine && /*#__PURE__*/_jsx(Line, _extends({
|
|
@@ -174,7 +173,7 @@ function ChartsYAxis(inProps) {
|
|
|
174
173
|
className: classes.line
|
|
175
174
|
}, lineSlotProps)), yTicks.map(({
|
|
176
175
|
formattedValue,
|
|
177
|
-
offset,
|
|
176
|
+
offset: tickOffset,
|
|
178
177
|
labelOffset,
|
|
179
178
|
value
|
|
180
179
|
}, index) => {
|
|
@@ -183,7 +182,7 @@ function ChartsYAxis(inProps) {
|
|
|
183
182
|
const skipLabel = typeof tickLabelInterval === 'function' && !tickLabelInterval?.(value, index);
|
|
184
183
|
const showLabel = instance.isPointInside({
|
|
185
184
|
x: -1,
|
|
186
|
-
y:
|
|
185
|
+
y: tickOffset
|
|
187
186
|
}, {
|
|
188
187
|
direction: 'y'
|
|
189
188
|
});
|
|
@@ -191,7 +190,7 @@ function ChartsYAxis(inProps) {
|
|
|
191
190
|
return null;
|
|
192
191
|
}
|
|
193
192
|
return /*#__PURE__*/_jsxs("g", {
|
|
194
|
-
transform: `translate(0, ${
|
|
193
|
+
transform: `translate(0, ${tickOffset})`,
|
|
195
194
|
className: classes.tickContainer,
|
|
196
195
|
children: [!disableTicks && /*#__PURE__*/_jsx(Tick, _extends({
|
|
197
196
|
x2: positionSign * tickSize,
|
|
@@ -215,6 +214,7 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
215
214
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
216
215
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
217
216
|
// ----------------------------------------------------------------------
|
|
217
|
+
axis: PropTypes.oneOf(['y']),
|
|
218
218
|
/**
|
|
219
219
|
* The id of the axis to render.
|
|
220
220
|
* If undefined, it will be the first defined axis.
|
|
@@ -247,10 +247,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
247
247
|
* The style applied to the axis label.
|
|
248
248
|
*/
|
|
249
249
|
labelStyle: PropTypes.object,
|
|
250
|
-
/**
|
|
251
|
-
* Position of the axis.
|
|
252
|
-
*/
|
|
253
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
254
250
|
/**
|
|
255
251
|
* The props used for each component slot.
|
|
256
252
|
* @default {}
|
package/esm/Gauge/Gauge.js
CHANGED
|
@@ -97,14 +97,15 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
|
|
|
97
97
|
/**
|
|
98
98
|
* The margin between the SVG and the drawing area.
|
|
99
99
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
100
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
101
102
|
*/
|
|
102
|
-
margin: PropTypes.shape({
|
|
103
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
103
104
|
bottom: PropTypes.number,
|
|
104
105
|
left: PropTypes.number,
|
|
105
106
|
right: PropTypes.number,
|
|
106
107
|
top: PropTypes.number
|
|
107
|
-
}),
|
|
108
|
+
})]),
|
|
108
109
|
/**
|
|
109
110
|
* The radius between circle center and the end of the arc.
|
|
110
111
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -9,6 +9,7 @@ import { styled } from '@mui/material/styles';
|
|
|
9
9
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
10
10
|
import { GaugeProvider } from "./GaugeProvider.js";
|
|
11
11
|
import { ChartProvider } from "../context/ChartProvider/index.js";
|
|
12
|
+
import { defaultizeMargin } from "../internals/defaultizeMargin.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const GStyled = styled('g')(({
|
|
14
15
|
theme
|
|
@@ -41,12 +42,12 @@ const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(pro
|
|
|
41
42
|
pluginParams: {
|
|
42
43
|
width: inWidth,
|
|
43
44
|
height: inHeight,
|
|
44
|
-
margin:
|
|
45
|
+
margin: defaultizeMargin(margin, {
|
|
45
46
|
left: 10,
|
|
46
47
|
right: 10,
|
|
47
48
|
top: 10,
|
|
48
49
|
bottom: 10
|
|
49
|
-
}
|
|
50
|
+
})
|
|
50
51
|
},
|
|
51
52
|
plugins: [],
|
|
52
53
|
children: /*#__PURE__*/_jsx(GaugeProvider, {
|
|
@@ -127,14 +128,15 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
|
|
|
127
128
|
/**
|
|
128
129
|
* The margin between the SVG and the drawing area.
|
|
129
130
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
130
|
-
*
|
|
131
|
+
*
|
|
132
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
131
133
|
*/
|
|
132
|
-
margin: PropTypes.shape({
|
|
134
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
133
135
|
bottom: PropTypes.number,
|
|
134
136
|
left: PropTypes.number,
|
|
135
137
|
right: PropTypes.number,
|
|
136
138
|
top: PropTypes.number
|
|
137
|
-
}),
|
|
139
|
+
})]),
|
|
138
140
|
/**
|
|
139
141
|
* The radius between circle center and the end of the arc.
|
|
140
142
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -21,7 +21,7 @@ export interface LineChartProps extends Omit<ChartContainerProps<'line', LineCha
|
|
|
21
21
|
* The series to display in the line chart.
|
|
22
22
|
* An array of [[LineSeriesType]] objects.
|
|
23
23
|
*/
|
|
24
|
-
series: MakeOptional<LineSeriesType, 'type'>[]
|
|
24
|
+
series: Readonly<MakeOptional<LineSeriesType, 'type'>[]>;
|
|
25
25
|
/**
|
|
26
26
|
* Option to display a cartesian grid in the background.
|
|
27
27
|
*/
|
|
@@ -87,12 +87,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
87
87
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
88
88
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
89
89
|
}),
|
|
90
|
-
/**
|
|
91
|
-
* Indicate which axis to display the bottom of the charts.
|
|
92
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
93
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
94
|
-
*/
|
|
95
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
96
90
|
children: PropTypes.node,
|
|
97
91
|
className: PropTypes.string,
|
|
98
92
|
/**
|
|
@@ -143,12 +137,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
143
137
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
144
138
|
*/
|
|
145
139
|
id: PropTypes.string,
|
|
146
|
-
/**
|
|
147
|
-
* Indicate which axis to display the left of the charts.
|
|
148
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
149
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
150
|
-
*/
|
|
151
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
152
140
|
/**
|
|
153
141
|
* If `true`, a loading overlay is displayed.
|
|
154
142
|
* @default false
|
|
@@ -157,14 +145,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
157
145
|
/**
|
|
158
146
|
* The margin between the SVG and the drawing area.
|
|
159
147
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
160
|
-
*
|
|
148
|
+
*
|
|
149
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
161
150
|
*/
|
|
162
|
-
margin: PropTypes.shape({
|
|
151
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
163
152
|
bottom: PropTypes.number,
|
|
164
153
|
left: PropTypes.number,
|
|
165
154
|
right: PropTypes.number,
|
|
166
155
|
top: PropTypes.number
|
|
167
|
-
}),
|
|
156
|
+
})]),
|
|
168
157
|
/**
|
|
169
158
|
* Callback fired when an area element is clicked.
|
|
170
159
|
*/
|
|
@@ -190,12 +179,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
190
179
|
* Callback fired when a mark element is clicked.
|
|
191
180
|
*/
|
|
192
181
|
onMarkClick: PropTypes.func,
|
|
193
|
-
/**
|
|
194
|
-
* Indicate which axis to display the right of the charts.
|
|
195
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
196
|
-
* @default null
|
|
197
|
-
*/
|
|
198
|
-
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
199
182
|
/**
|
|
200
183
|
* The series to display in the line chart.
|
|
201
184
|
* An array of [[LineSeriesType]] objects.
|
|
@@ -219,12 +202,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
219
202
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
220
203
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
221
204
|
title: PropTypes.string,
|
|
222
|
-
/**
|
|
223
|
-
* Indicate which axis to display the top of the charts.
|
|
224
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
225
|
-
* @default null
|
|
226
|
-
*/
|
|
227
|
-
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
228
205
|
/**
|
|
229
206
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
230
207
|
*/
|
|
@@ -235,6 +212,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
235
212
|
* An array of [[AxisConfig]] objects.
|
|
236
213
|
*/
|
|
237
214
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
215
|
+
axis: PropTypes.oneOf(['x']),
|
|
238
216
|
classes: PropTypes.object,
|
|
239
217
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
240
218
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -257,13 +235,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
257
235
|
disableTicks: PropTypes.bool,
|
|
258
236
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
259
237
|
fill: PropTypes.string,
|
|
238
|
+
height: PropTypes.number,
|
|
260
239
|
hideTooltip: PropTypes.bool,
|
|
261
240
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
262
241
|
label: PropTypes.string,
|
|
263
242
|
labelStyle: PropTypes.object,
|
|
264
243
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
265
244
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
266
|
-
|
|
245
|
+
offset: PropTypes.number,
|
|
246
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
267
247
|
reverse: PropTypes.bool,
|
|
268
248
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
269
249
|
slotProps: PropTypes.object,
|
|
@@ -272,6 +252,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
272
252
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
273
253
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
274
254
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
255
|
+
tickLabelMinGap: PropTypes.number,
|
|
275
256
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
276
257
|
tickLabelStyle: PropTypes.object,
|
|
277
258
|
tickMaxStep: PropTypes.number,
|
|
@@ -287,6 +268,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
287
268
|
* An array of [[AxisConfig]] objects.
|
|
288
269
|
*/
|
|
289
270
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
271
|
+
axis: PropTypes.oneOf(['y']),
|
|
290
272
|
classes: PropTypes.object,
|
|
291
273
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
292
274
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -315,7 +297,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
315
297
|
labelStyle: PropTypes.object,
|
|
316
298
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
317
299
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
318
|
-
|
|
300
|
+
offset: PropTypes.number,
|
|
301
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
319
302
|
reverse: PropTypes.bool,
|
|
320
303
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
321
304
|
slotProps: PropTypes.object,
|
|
@@ -331,7 +314,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
331
314
|
tickNumber: PropTypes.number,
|
|
332
315
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
333
316
|
tickSize: PropTypes.number,
|
|
334
|
-
valueFormatter: PropTypes.func
|
|
317
|
+
valueFormatter: PropTypes.func,
|
|
318
|
+
width: PropTypes.number
|
|
335
319
|
}))
|
|
336
320
|
} : void 0;
|
|
337
321
|
export { LineChart };
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
6
|
import useId from '@mui/utils/useId';
|
|
7
7
|
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
8
|
-
import { calculateMargins } from "../internals/calculateMargins.js";
|
|
9
8
|
import { LINE_CHART_PLUGINS } from "./LineChart.plugins.js";
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -31,12 +30,7 @@ export const useLineChartProps = props => {
|
|
|
31
30
|
onMarkClick,
|
|
32
31
|
axisHighlight,
|
|
33
32
|
disableLineItemHighlight,
|
|
34
|
-
hideLegend,
|
|
35
33
|
grid,
|
|
36
|
-
topAxis,
|
|
37
|
-
leftAxis,
|
|
38
|
-
rightAxis,
|
|
39
|
-
bottomAxis,
|
|
40
34
|
children,
|
|
41
35
|
slots,
|
|
42
36
|
slotProps,
|
|
@@ -56,12 +50,7 @@ export const useLineChartProps = props => {
|
|
|
56
50
|
}, s)),
|
|
57
51
|
width,
|
|
58
52
|
height,
|
|
59
|
-
margin
|
|
60
|
-
margin,
|
|
61
|
-
hideLegend,
|
|
62
|
-
slotProps,
|
|
63
|
-
series
|
|
64
|
-
}),
|
|
53
|
+
margin,
|
|
65
54
|
colors,
|
|
66
55
|
dataset,
|
|
67
56
|
xAxis: xAxis ?? [{
|
|
@@ -111,10 +100,6 @@ export const useLineChartProps = props => {
|
|
|
111
100
|
loading
|
|
112
101
|
};
|
|
113
102
|
const chartsAxisProps = {
|
|
114
|
-
topAxis,
|
|
115
|
-
leftAxis,
|
|
116
|
-
rightAxis,
|
|
117
|
-
bottomAxis,
|
|
118
103
|
slots,
|
|
119
104
|
slotProps
|
|
120
105
|
};
|
|
@@ -133,7 +133,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
133
133
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
134
134
|
index: PropTypes.number.isRequired,
|
|
135
135
|
label: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
136
|
-
labelMarkType: PropTypes.oneOf(['circle', 'line', 'square']),
|
|
136
|
+
labelMarkType: PropTypes.oneOfType([PropTypes.oneOf(['circle', 'line', 'square']), PropTypes.func]),
|
|
137
137
|
padAngle: PropTypes.number.isRequired,
|
|
138
138
|
startAngle: PropTypes.number.isRequired,
|
|
139
139
|
value: PropTypes.number.isRequired
|
|
@@ -99,7 +99,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
99
99
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
100
100
|
index: PropTypes.number.isRequired,
|
|
101
101
|
label: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
102
|
-
labelMarkType: PropTypes.oneOf(['circle', 'line', 'square']),
|
|
102
|
+
labelMarkType: PropTypes.oneOfType([PropTypes.oneOf(['circle', 'line', 'square']), PropTypes.func]),
|
|
103
103
|
padAngle: PropTypes.number.isRequired,
|
|
104
104
|
startAngle: PropTypes.number.isRequired,
|
|
105
105
|
value: PropTypes.number.isRequired
|
|
@@ -15,7 +15,7 @@ export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartP
|
|
|
15
15
|
* The series to display in the pie chart.
|
|
16
16
|
* An array of [[PieSeriesType]] objects.
|
|
17
17
|
*/
|
|
18
|
-
series: MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[]
|
|
18
|
+
series: Readonly<MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[]>;
|
|
19
19
|
/**
|
|
20
20
|
* If `true`, the legend is not rendered.
|
|
21
21
|
*/
|
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -15,6 +15,7 @@ import { ChartDataProvider } from "../ChartDataProvider/index.js";
|
|
|
15
15
|
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
16
16
|
import { ChartsWrapper } from "../internals/components/ChartsWrapper/index.js";
|
|
17
17
|
import { PIE_CHART_PLUGINS } from "./PieChart.plugins.js";
|
|
18
|
+
import { defaultizeMargin } from "../internals/defaultizeMargin.js";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const defaultMargin = {
|
|
20
21
|
top: 5,
|
|
@@ -57,7 +58,7 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
57
58
|
className
|
|
58
59
|
} = props,
|
|
59
60
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60
|
-
const margin =
|
|
61
|
+
const margin = defaultizeMargin(marginProps, defaultMargin);
|
|
61
62
|
const {
|
|
62
63
|
chartDataProviderProps,
|
|
63
64
|
chartsSurfaceProps
|
|
@@ -150,14 +151,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
150
151
|
/**
|
|
151
152
|
* The margin between the SVG and the drawing area.
|
|
152
153
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
153
|
-
*
|
|
154
|
+
*
|
|
155
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
154
156
|
*/
|
|
155
|
-
margin: PropTypes.shape({
|
|
157
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
156
158
|
bottom: PropTypes.number,
|
|
157
159
|
left: PropTypes.number,
|
|
158
160
|
right: PropTypes.number,
|
|
159
161
|
top: PropTypes.number
|
|
160
|
-
}),
|
|
162
|
+
})]),
|
|
161
163
|
/**
|
|
162
164
|
* The callback fired when the highlighted item changes.
|
|
163
165
|
*
|
|
@@ -19,7 +19,7 @@ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', S
|
|
|
19
19
|
* The series to display in the scatter chart.
|
|
20
20
|
* An array of [[ScatterSeriesType]] objects.
|
|
21
21
|
*/
|
|
22
|
-
series: MakeOptional<ScatterSeriesType, 'type'>[]
|
|
22
|
+
series: Readonly<MakeOptional<ScatterSeriesType, 'type'>[]>;
|
|
23
23
|
/**
|
|
24
24
|
* The configuration of axes highlight.
|
|
25
25
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -78,12 +78,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
78
78
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
79
79
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
80
80
|
}),
|
|
81
|
-
/**
|
|
82
|
-
* Indicate which axis to display the bottom of the charts.
|
|
83
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
84
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
85
|
-
*/
|
|
86
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
87
81
|
children: PropTypes.node,
|
|
88
82
|
className: PropTypes.string,
|
|
89
83
|
/**
|
|
@@ -135,12 +129,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
135
129
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
136
130
|
*/
|
|
137
131
|
id: PropTypes.string,
|
|
138
|
-
/**
|
|
139
|
-
* Indicate which axis to display the left of the charts.
|
|
140
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
141
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
142
|
-
*/
|
|
143
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
144
132
|
/**
|
|
145
133
|
* If `true`, a loading overlay is displayed.
|
|
146
134
|
* @default false
|
|
@@ -149,14 +137,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
149
137
|
/**
|
|
150
138
|
* The margin between the SVG and the drawing area.
|
|
151
139
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
152
|
-
*
|
|
140
|
+
*
|
|
141
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
153
142
|
*/
|
|
154
|
-
margin: PropTypes.shape({
|
|
143
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
155
144
|
bottom: PropTypes.number,
|
|
156
145
|
left: PropTypes.number,
|
|
157
146
|
right: PropTypes.number,
|
|
158
147
|
top: PropTypes.number
|
|
159
|
-
}),
|
|
148
|
+
})]),
|
|
160
149
|
/**
|
|
161
150
|
* The function called for onClick events.
|
|
162
151
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -176,12 +165,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
176
165
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
177
166
|
*/
|
|
178
167
|
onItemClick: PropTypes.func,
|
|
179
|
-
/**
|
|
180
|
-
* Indicate which axis to display the right of the charts.
|
|
181
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
182
|
-
* @default null
|
|
183
|
-
*/
|
|
184
|
-
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
185
168
|
/**
|
|
186
169
|
* The series to display in the scatter chart.
|
|
187
170
|
* An array of [[ScatterSeriesType]] objects.
|
|
@@ -205,12 +188,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
205
188
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
206
189
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
207
190
|
title: PropTypes.string,
|
|
208
|
-
/**
|
|
209
|
-
* Indicate which axis to display the top of the charts.
|
|
210
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
211
|
-
* @default null
|
|
212
|
-
*/
|
|
213
|
-
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
214
191
|
/**
|
|
215
192
|
* Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
|
|
216
193
|
* If `undefined`, the radius is assumed to be infinite.
|
|
@@ -226,6 +203,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
226
203
|
* An array of [[AxisConfig]] objects.
|
|
227
204
|
*/
|
|
228
205
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
206
|
+
axis: PropTypes.oneOf(['x']),
|
|
229
207
|
classes: PropTypes.object,
|
|
230
208
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
231
209
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -248,13 +226,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
248
226
|
disableTicks: PropTypes.bool,
|
|
249
227
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
250
228
|
fill: PropTypes.string,
|
|
229
|
+
height: PropTypes.number,
|
|
251
230
|
hideTooltip: PropTypes.bool,
|
|
252
231
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
253
232
|
label: PropTypes.string,
|
|
254
233
|
labelStyle: PropTypes.object,
|
|
255
234
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
256
235
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
257
|
-
|
|
236
|
+
offset: PropTypes.number,
|
|
237
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
258
238
|
reverse: PropTypes.bool,
|
|
259
239
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
260
240
|
slotProps: PropTypes.object,
|
|
@@ -263,6 +243,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
263
243
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
264
244
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
265
245
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
246
|
+
tickLabelMinGap: PropTypes.number,
|
|
266
247
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
267
248
|
tickLabelStyle: PropTypes.object,
|
|
268
249
|
tickMaxStep: PropTypes.number,
|
|
@@ -278,6 +259,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
278
259
|
* An array of [[AxisConfig]] objects.
|
|
279
260
|
*/
|
|
280
261
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
262
|
+
axis: PropTypes.oneOf(['y']),
|
|
281
263
|
classes: PropTypes.object,
|
|
282
264
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
283
265
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -306,7 +288,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
306
288
|
labelStyle: PropTypes.object,
|
|
307
289
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
308
290
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
309
|
-
|
|
291
|
+
offset: PropTypes.number,
|
|
292
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
310
293
|
reverse: PropTypes.bool,
|
|
311
294
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
312
295
|
slotProps: PropTypes.object,
|
|
@@ -322,7 +305,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
322
305
|
tickNumber: PropTypes.number,
|
|
323
306
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
324
307
|
tickSize: PropTypes.number,
|
|
325
|
-
valueFormatter: PropTypes.func
|
|
308
|
+
valueFormatter: PropTypes.func,
|
|
309
|
+
width: PropTypes.number
|
|
326
310
|
})),
|
|
327
311
|
/**
|
|
328
312
|
* The configuration of the z-axes.
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "
|
|
6
|
-
import { calculateMargins } from "../internals/calculateMargins.js";
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
7
6
|
import { SCATTER_CHART_PLUGINS } from "./ScatterChart.plugins.js";
|
|
8
7
|
/**
|
|
9
8
|
* A helper function that extracts ScatterChartProps from the input props
|
|
@@ -21,17 +20,12 @@ export const useScatterChartProps = props => {
|
|
|
21
20
|
axisHighlight,
|
|
22
21
|
voronoiMaxRadius,
|
|
23
22
|
disableVoronoi,
|
|
24
|
-
hideLegend,
|
|
25
23
|
width,
|
|
26
24
|
height,
|
|
27
25
|
margin,
|
|
28
26
|
colors,
|
|
29
27
|
sx,
|
|
30
28
|
grid,
|
|
31
|
-
topAxis,
|
|
32
|
-
leftAxis,
|
|
33
|
-
rightAxis,
|
|
34
|
-
bottomAxis,
|
|
35
29
|
onItemClick,
|
|
36
30
|
children,
|
|
37
31
|
slots,
|
|
@@ -48,12 +42,7 @@ export const useScatterChartProps = props => {
|
|
|
48
42
|
}, s)),
|
|
49
43
|
width,
|
|
50
44
|
height,
|
|
51
|
-
margin
|
|
52
|
-
margin,
|
|
53
|
-
hideLegend,
|
|
54
|
-
slotProps,
|
|
55
|
-
series
|
|
56
|
-
}),
|
|
45
|
+
margin,
|
|
57
46
|
colors,
|
|
58
47
|
xAxis,
|
|
59
48
|
yAxis,
|
|
@@ -67,10 +56,6 @@ export const useScatterChartProps = props => {
|
|
|
67
56
|
plugins: SCATTER_CHART_PLUGINS
|
|
68
57
|
});
|
|
69
58
|
const chartsAxisProps = {
|
|
70
|
-
topAxis,
|
|
71
|
-
leftAxis,
|
|
72
|
-
rightAxis,
|
|
73
|
-
bottomAxis,
|
|
74
59
|
slots,
|
|
75
60
|
slotProps
|
|
76
61
|
};
|
|
@@ -67,15 +67,11 @@ export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series'
|
|
|
67
67
|
/**
|
|
68
68
|
* The margin between the SVG and the drawing area.
|
|
69
69
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* bottom: 5,
|
|
74
|
-
* left: 5,
|
|
75
|
-
* right: 5,
|
|
76
|
-
* }
|
|
70
|
+
*
|
|
71
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
72
|
+
* @default 5
|
|
77
73
|
*/
|
|
78
|
-
margin?: Partial<ChartMargin
|
|
74
|
+
margin?: Partial<ChartMargin> | number;
|
|
79
75
|
/**
|
|
80
76
|
* Overridable component slots.
|
|
81
77
|
* @default {}
|