@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
package/models/axis.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, ScalePoint, ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
|
|
2
2
|
import { SxProps } from '@mui/system/styleFunctionSx';
|
|
3
|
+
import { MakeRequired } from '@mui/x-internals/types';
|
|
3
4
|
import { ChartsAxisClasses } from "../ChartsAxis/axisClasses.js";
|
|
4
5
|
import type { TickParams } from '../hooks/useTicks';
|
|
5
6
|
import { ChartsTextProps } from "../ChartsText/index.js";
|
|
@@ -104,17 +105,54 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
104
105
|
sx?: SxProps;
|
|
105
106
|
}
|
|
106
107
|
export interface ChartsYAxisProps extends ChartsAxisProps {
|
|
108
|
+
axis?: 'y';
|
|
109
|
+
}
|
|
110
|
+
export interface ChartsXAxisProps extends ChartsAxisProps {
|
|
111
|
+
axis?: 'x';
|
|
107
112
|
/**
|
|
108
|
-
*
|
|
113
|
+
* The minimum gap in pixels between two tick labels.
|
|
114
|
+
* If two tick labels are closer than this minimum gap, one of them will be hidden.
|
|
115
|
+
* @default 4
|
|
109
116
|
*/
|
|
110
|
-
|
|
117
|
+
tickLabelMinGap?: number;
|
|
111
118
|
}
|
|
112
|
-
|
|
119
|
+
type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends ChartsXAxisProps ? {
|
|
113
120
|
/**
|
|
114
121
|
* Position of the axis.
|
|
122
|
+
*
|
|
123
|
+
* When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
|
|
124
|
+
*
|
|
125
|
+
* Set to 'none' to hide the axis.
|
|
126
|
+
*
|
|
127
|
+
* The first axis in the list will always have a default position.
|
|
115
128
|
*/
|
|
116
|
-
position?: 'top' | 'bottom';
|
|
117
|
-
|
|
129
|
+
position?: 'top' | 'bottom' | 'none';
|
|
130
|
+
/**
|
|
131
|
+
* The height of the axis.
|
|
132
|
+
* @default 30
|
|
133
|
+
*/
|
|
134
|
+
height?: number;
|
|
135
|
+
} : AxisProps extends ChartsYAxisProps ? {
|
|
136
|
+
/**
|
|
137
|
+
* Position of the axis.
|
|
138
|
+
*
|
|
139
|
+
* When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
|
|
140
|
+
*
|
|
141
|
+
* Set to 'none' to hide the axis.
|
|
142
|
+
*
|
|
143
|
+
* The first axis in the list will always have a default position.
|
|
144
|
+
*/
|
|
145
|
+
position?: 'left' | 'right' | 'none';
|
|
146
|
+
/**
|
|
147
|
+
* The width of the axis.
|
|
148
|
+
* @default 30
|
|
149
|
+
*/
|
|
150
|
+
width?: number;
|
|
151
|
+
} : {
|
|
152
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
153
|
+
height?: number;
|
|
154
|
+
width?: number;
|
|
155
|
+
};
|
|
118
156
|
export interface ChartsRotationAxisProps extends ChartsAxisProps {
|
|
119
157
|
/**
|
|
120
158
|
* The start angle (in deg).
|
|
@@ -242,7 +280,7 @@ export type AxisValueFormatterContext<S extends ScaleName = ScaleName> = {
|
|
|
242
280
|
*/
|
|
243
281
|
scale: AxisScaleConfig[S]['scale'];
|
|
244
282
|
};
|
|
245
|
-
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
|
|
283
|
+
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
|
|
246
284
|
/**
|
|
247
285
|
* Id used to identify the axis.
|
|
248
286
|
*/
|
|
@@ -260,7 +298,7 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
|
|
|
260
298
|
/**
|
|
261
299
|
* The data used by `'band'` and `'point'` scales.
|
|
262
300
|
*/
|
|
263
|
-
data?: V[];
|
|
301
|
+
data?: readonly V[];
|
|
264
302
|
/**
|
|
265
303
|
* The key used to retrieve `data` from the `dataset` prop.
|
|
266
304
|
*/
|
|
@@ -280,6 +318,13 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
|
|
|
280
318
|
* If `true`, Reverse the axis scaleBand.
|
|
281
319
|
*/
|
|
282
320
|
reverse?: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
323
|
+
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
324
|
+
* Y-axis: A left axis will move left, and a right axis will move right.
|
|
325
|
+
* @default 0
|
|
326
|
+
*/
|
|
327
|
+
offset?: number;
|
|
283
328
|
/**
|
|
284
329
|
* Defines the axis scale domain based on the min/max values of series linked to it.
|
|
285
330
|
* - 'nice': Rounds the domain at human friendly values.
|
|
@@ -290,9 +335,9 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
|
|
|
290
335
|
min: number;
|
|
291
336
|
max: number;
|
|
292
337
|
});
|
|
293
|
-
} & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
|
|
338
|
+
} & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
|
|
294
339
|
export interface AxisConfigExtension {}
|
|
295
|
-
export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps = ChartsXAxisProps | ChartsYAxisProps> = Omit<AxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
|
|
340
|
+
export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = MakeRequired<Omit<AxisConfig<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisSideConfig<AxisProps> & AxisScaleComputedConfig[S] & {
|
|
296
341
|
/**
|
|
297
342
|
* An indication of the expected number of ticks.
|
|
298
343
|
*/
|
|
@@ -320,4 +365,5 @@ export interface ChartsAxisData {
|
|
|
320
365
|
* The mapping of series ids to their value for this particular axis index.
|
|
321
366
|
*/
|
|
322
367
|
seriesValues: Record<string, number | null | undefined>;
|
|
323
|
-
}
|
|
368
|
+
}
|
|
369
|
+
export {};
|
package/models/colorMapping.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface OrdinalColorConfig<Value = number | Date | string> {
|
|
|
33
33
|
* The value to map.
|
|
34
34
|
* If undefined, it will be integers from 0 to the number of colors.
|
|
35
35
|
*/
|
|
36
|
-
values?: Value[];
|
|
36
|
+
values?: readonly Value[];
|
|
37
37
|
/**
|
|
38
38
|
* The color palette.
|
|
39
39
|
* Items equal to `values[k]` will get the color of `colors[k]`.
|
package/models/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from "./seriesType/index.js";
|
|
2
|
-
export * from "./layout.js";
|
|
3
2
|
export * from "./stacking.js";
|
|
4
3
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData } from './axis';
|
|
5
4
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
package/models/index.js
CHANGED
|
@@ -14,17 +14,6 @@ Object.keys(_seriesType).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _layout = require("./layout");
|
|
18
|
-
Object.keys(_layout).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _layout[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _layout[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _stacking = require("./stacking");
|
|
29
18
|
Object.keys(_stacking).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -76,6 +76,6 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
|
|
|
76
76
|
} : ChartsSeriesConfig[T]['series'];
|
|
77
77
|
export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
|
|
78
78
|
export type DatasetElementType<T> = {
|
|
79
|
-
[key: string]: T
|
|
79
|
+
[key: string]: Readonly<T>;
|
|
80
80
|
};
|
|
81
81
|
export type DatasetType<T = number | string | Date | null | undefined> = DatasetElementType<T>[];
|
|
@@ -29,7 +29,7 @@ export interface LineSeriesType extends CommonSeriesType<number | null>, Cartesi
|
|
|
29
29
|
/**
|
|
30
30
|
* Data associated to the line.
|
|
31
31
|
*/
|
|
32
|
-
data?: (number | null)[];
|
|
32
|
+
data?: readonly (number | null)[];
|
|
33
33
|
/**
|
|
34
34
|
* The key used to retrieve data from the dataset.
|
|
35
35
|
*/
|
|
@@ -27,7 +27,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
|
|
|
27
27
|
export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
|
|
28
28
|
export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData> {
|
|
29
29
|
type: 'pie';
|
|
30
|
-
data: TData[]
|
|
30
|
+
data: Readonly<TData[]>;
|
|
31
31
|
/**
|
|
32
32
|
* The radius between circle center and the beginning of the arc.
|
|
33
33
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -11,7 +11,7 @@ export type ScatterValueType = {
|
|
|
11
11
|
};
|
|
12
12
|
export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null>, CartesianSeriesType {
|
|
13
13
|
type: 'scatter';
|
|
14
|
-
data?: ScatterValueType[];
|
|
14
|
+
data?: readonly ScatterValueType[];
|
|
15
15
|
markerSize?: number;
|
|
16
16
|
/**
|
|
17
17
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
package/models/z-axis.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-chart
|
|
|
2
2
|
import { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
|
|
3
3
|
export interface ZAxisConfig<V = any> {
|
|
4
4
|
id: string;
|
|
5
|
-
data?: V[];
|
|
5
|
+
data?: readonly V[];
|
|
6
6
|
/**
|
|
7
7
|
* The key used to retrieve `data` from the `dataset` prop.
|
|
8
8
|
*/
|
|
@@ -18,7 +18,7 @@ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartP
|
|
|
18
18
|
* The series to display in the bar chart.
|
|
19
19
|
* An array of [[BarSeriesType]] objects.
|
|
20
20
|
*/
|
|
21
|
-
series: MakeOptional<BarSeriesType, 'type'>[]
|
|
21
|
+
series: Readonly<MakeOptional<BarSeriesType, 'type'>[]>;
|
|
22
22
|
/**
|
|
23
23
|
* Option to display a cartesian grid in the background.
|
|
24
24
|
*/
|
|
@@ -92,12 +92,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
92
92
|
* Defines the border radius of the bar element.
|
|
93
93
|
*/
|
|
94
94
|
borderRadius: PropTypes.number,
|
|
95
|
-
/**
|
|
96
|
-
* Indicate which axis to display the bottom of the charts.
|
|
97
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
98
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
99
|
-
*/
|
|
100
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
101
95
|
children: PropTypes.node,
|
|
102
96
|
className: PropTypes.string,
|
|
103
97
|
/**
|
|
@@ -149,12 +143,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
149
143
|
* @default 'vertical'
|
|
150
144
|
*/
|
|
151
145
|
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
152
|
-
/**
|
|
153
|
-
* Indicate which axis to display the left of the charts.
|
|
154
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
155
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
156
|
-
*/
|
|
157
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
158
146
|
/**
|
|
159
147
|
* If `true`, a loading overlay is displayed.
|
|
160
148
|
* @default false
|
|
@@ -163,14 +151,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
163
151
|
/**
|
|
164
152
|
* The margin between the SVG and the drawing area.
|
|
165
153
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
166
|
-
*
|
|
154
|
+
*
|
|
155
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
167
156
|
*/
|
|
168
|
-
margin: PropTypes.shape({
|
|
157
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
169
158
|
bottom: PropTypes.number,
|
|
170
159
|
left: PropTypes.number,
|
|
171
160
|
right: PropTypes.number,
|
|
172
161
|
top: PropTypes.number
|
|
173
|
-
}),
|
|
162
|
+
})]),
|
|
174
163
|
/**
|
|
175
164
|
* The function called for onClick events.
|
|
176
165
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -190,12 +179,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
190
179
|
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
191
180
|
*/
|
|
192
181
|
onItemClick: 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 bar chart.
|
|
201
184
|
* An array of [[BarSeriesType]] objects.
|
|
@@ -219,12 +202,6 @@ process.env.NODE_ENV !== "production" ? BarChart.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" ? BarChart.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" ? BarChart.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" ? BarChart.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" ? BarChart.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" ? BarChart.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" ? BarChart.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 { BarChart };
|
|
@@ -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", "axisHighlight", "grid", "
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
|
|
6
6
|
import useId from '@mui/utils/useId';
|
|
7
7
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
|
|
8
|
-
import { calculateMargins } from "../internals/calculateMargins.js";
|
|
9
8
|
import { BAR_CHART_PLUGINS } from "./BarChart.plugins.js";
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -28,10 +27,6 @@ export const useBarChartProps = props => {
|
|
|
28
27
|
sx,
|
|
29
28
|
axisHighlight,
|
|
30
29
|
grid,
|
|
31
|
-
topAxis,
|
|
32
|
-
leftAxis,
|
|
33
|
-
rightAxis,
|
|
34
|
-
bottomAxis,
|
|
35
30
|
children,
|
|
36
31
|
slots,
|
|
37
32
|
slotProps,
|
|
@@ -43,8 +38,7 @@ export const useBarChartProps = props => {
|
|
|
43
38
|
onHighlightChange,
|
|
44
39
|
borderRadius,
|
|
45
40
|
barLabel,
|
|
46
|
-
className
|
|
47
|
-
hideLegend
|
|
41
|
+
className
|
|
48
42
|
} = props,
|
|
49
43
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
50
44
|
const id = useId();
|
|
@@ -64,12 +58,7 @@ export const useBarChartProps = props => {
|
|
|
64
58
|
})),
|
|
65
59
|
width,
|
|
66
60
|
height,
|
|
67
|
-
margin
|
|
68
|
-
margin,
|
|
69
|
-
hideLegend,
|
|
70
|
-
slotProps,
|
|
71
|
-
series
|
|
72
|
-
}),
|
|
61
|
+
margin,
|
|
73
62
|
colors,
|
|
74
63
|
dataset,
|
|
75
64
|
xAxis: xAxis ?? (hasHorizontalSeries ? undefined : [_extends({
|
|
@@ -108,10 +97,6 @@ export const useBarChartProps = props => {
|
|
|
108
97
|
loading
|
|
109
98
|
};
|
|
110
99
|
const chartsAxisProps = {
|
|
111
|
-
topAxis,
|
|
112
|
-
leftAxis,
|
|
113
|
-
rightAxis,
|
|
114
|
-
bottomAxis,
|
|
115
100
|
slots,
|
|
116
101
|
slotProps
|
|
117
102
|
};
|
|
@@ -25,7 +25,7 @@ export type ChartContainerProps<SeriesType extends ChartSeriesType = ChartSeries
|
|
|
25
25
|
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
26
26
|
* >
|
|
27
27
|
* <BarPlot />
|
|
28
|
-
* <ChartsXAxis
|
|
28
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
29
29
|
* </ChartContainer>
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
27
27
|
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
28
28
|
* >
|
|
29
29
|
* <BarPlot />
|
|
30
|
-
* <ChartsXAxis
|
|
30
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
31
31
|
* </ChartContainer>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
@@ -96,14 +96,15 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
96
96
|
/**
|
|
97
97
|
* The margin between the SVG and the drawing area.
|
|
98
98
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
99
|
-
*
|
|
99
|
+
*
|
|
100
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
100
101
|
*/
|
|
101
|
-
margin: PropTypes.shape({
|
|
102
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
102
103
|
bottom: PropTypes.number,
|
|
103
104
|
left: PropTypes.number,
|
|
104
105
|
right: PropTypes.number,
|
|
105
106
|
top: PropTypes.number
|
|
106
|
-
}),
|
|
107
|
+
})]),
|
|
107
108
|
/**
|
|
108
109
|
* The function called for onClick events.
|
|
109
110
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -153,6 +154,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
153
154
|
* An array of [[AxisConfig]] objects.
|
|
154
155
|
*/
|
|
155
156
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
157
|
+
axis: PropTypes.oneOf(['x']),
|
|
156
158
|
classes: PropTypes.object,
|
|
157
159
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
158
160
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -175,13 +177,15 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
175
177
|
disableTicks: PropTypes.bool,
|
|
176
178
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
177
179
|
fill: PropTypes.string,
|
|
180
|
+
height: PropTypes.number,
|
|
178
181
|
hideTooltip: PropTypes.bool,
|
|
179
182
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
180
183
|
label: PropTypes.string,
|
|
181
184
|
labelStyle: PropTypes.object,
|
|
182
185
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
183
186
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
184
|
-
|
|
187
|
+
offset: PropTypes.number,
|
|
188
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
185
189
|
reverse: PropTypes.bool,
|
|
186
190
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
187
191
|
slotProps: PropTypes.object,
|
|
@@ -190,6 +194,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
190
194
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
191
195
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
192
196
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
197
|
+
tickLabelMinGap: PropTypes.number,
|
|
193
198
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
194
199
|
tickLabelStyle: PropTypes.object,
|
|
195
200
|
tickMaxStep: PropTypes.number,
|
|
@@ -205,6 +210,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
205
210
|
* An array of [[AxisConfig]] objects.
|
|
206
211
|
*/
|
|
207
212
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
213
|
+
axis: PropTypes.oneOf(['y']),
|
|
208
214
|
classes: PropTypes.object,
|
|
209
215
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
210
216
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -233,7 +239,8 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
233
239
|
labelStyle: PropTypes.object,
|
|
234
240
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
235
241
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
236
|
-
|
|
242
|
+
offset: PropTypes.number,
|
|
243
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
237
244
|
reverse: PropTypes.bool,
|
|
238
245
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
239
246
|
slotProps: PropTypes.object,
|
|
@@ -249,7 +256,8 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
249
256
|
tickNumber: PropTypes.number,
|
|
250
257
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
251
258
|
tickSize: PropTypes.number,
|
|
252
|
-
valueFormatter: PropTypes.func
|
|
259
|
+
valueFormatter: PropTypes.func,
|
|
260
|
+
width: PropTypes.number
|
|
253
261
|
})),
|
|
254
262
|
/**
|
|
255
263
|
* The configuration of the z-axes.
|
|
@@ -14,7 +14,7 @@ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeries
|
|
|
14
14
|
*
|
|
15
15
|
* Demos:
|
|
16
16
|
*
|
|
17
|
-
* - [Composition](https://mui.com/x/
|
|
17
|
+
* - [Composition](https://mui.com/x/react-charts/composition/)
|
|
18
18
|
*
|
|
19
19
|
* API:
|
|
20
20
|
*
|
|
@@ -28,7 +28,7 @@ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeries
|
|
|
28
28
|
* >
|
|
29
29
|
* <ChartsSurface>
|
|
30
30
|
* <BarPlot />
|
|
31
|
-
* <ChartsXAxis
|
|
31
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
32
32
|
* </ChartsSurface>
|
|
33
33
|
* {'Custom Legend Component'}
|
|
34
34
|
* </ChartDataProvider>
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
*
|
|
15
15
|
* Demos:
|
|
16
16
|
*
|
|
17
|
-
* - [Composition](https://mui.com/x/
|
|
17
|
+
* - [Composition](https://mui.com/x/react-charts/composition/)
|
|
18
18
|
*
|
|
19
19
|
* API:
|
|
20
20
|
*
|
|
@@ -28,7 +28,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
28
28
|
* >
|
|
29
29
|
* <ChartsSurface>
|
|
30
30
|
* <BarPlot />
|
|
31
|
-
* <ChartsXAxis
|
|
31
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
32
32
|
* </ChartsSurface>
|
|
33
33
|
* {'Custom Legend Component'}
|
|
34
34
|
* </ChartDataProvider>
|
|
@@ -74,7 +74,8 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
74
74
|
/**
|
|
75
75
|
* The margin between the SVG and the drawing area.
|
|
76
76
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
77
|
-
*
|
|
77
|
+
*
|
|
78
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
78
79
|
*/
|
|
79
80
|
margin: PropTypes.any,
|
|
80
81
|
/**
|
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartsAxisSlotProps, ChartsAxisSlots
|
|
2
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
|
|
3
3
|
export interface ChartsAxisProps {
|
|
4
|
-
/**
|
|
5
|
-
* Indicate which axis to display the top of the charts.
|
|
6
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
7
|
-
* @default null
|
|
8
|
-
*/
|
|
9
|
-
topAxis?: null | string | ChartsXAxisProps;
|
|
10
|
-
/**
|
|
11
|
-
* Indicate which axis to display the bottom of the charts.
|
|
12
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
13
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
14
|
-
*/
|
|
15
|
-
bottomAxis?: null | string | ChartsXAxisProps;
|
|
16
|
-
/**
|
|
17
|
-
* Indicate which axis to display the left of the charts.
|
|
18
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
19
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
20
|
-
*/
|
|
21
|
-
leftAxis?: null | string | ChartsYAxisProps;
|
|
22
|
-
/**
|
|
23
|
-
* Indicate which axis to display the right of the charts.
|
|
24
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
25
|
-
* @default null
|
|
26
|
-
*/
|
|
27
|
-
rightAxis?: null | string | ChartsYAxisProps;
|
|
28
4
|
/**
|
|
29
5
|
* Overridable component slots.
|
|
30
6
|
* @default {}
|