@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
|
@@ -19,12 +19,7 @@ var _ChartsTooltip = require("../ChartsTooltip");
|
|
|
19
19
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
|
|
22
|
-
const
|
|
23
|
-
top: 5,
|
|
24
|
-
bottom: 5,
|
|
25
|
-
left: 5,
|
|
26
|
-
right: 5
|
|
27
|
-
};
|
|
22
|
+
const SPARK_LINE_DEFAULT_MARGIN = 5;
|
|
28
23
|
|
|
29
24
|
/**
|
|
30
25
|
* Demos:
|
|
@@ -41,7 +36,7 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
|
|
|
41
36
|
yAxis,
|
|
42
37
|
width,
|
|
43
38
|
height,
|
|
44
|
-
margin =
|
|
39
|
+
margin = SPARK_LINE_DEFAULT_MARGIN,
|
|
45
40
|
color,
|
|
46
41
|
sx,
|
|
47
42
|
showTooltip,
|
|
@@ -93,10 +88,14 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
|
|
|
93
88
|
length: data.length
|
|
94
89
|
}, (_, index) => index),
|
|
95
90
|
hideTooltip: xAxis === undefined
|
|
96
|
-
}, xAxis
|
|
91
|
+
}, xAxis, {
|
|
92
|
+
position: 'none'
|
|
93
|
+
})],
|
|
97
94
|
yAxis: [(0, _extends2.default)({
|
|
98
95
|
id: _constants.DEFAULT_Y_AXIS_KEY
|
|
99
|
-
}, yAxis
|
|
96
|
+
}, yAxis, {
|
|
97
|
+
position: 'none'
|
|
98
|
+
})],
|
|
100
99
|
colors: colors,
|
|
101
100
|
sx: sx,
|
|
102
101
|
disableAxisListener: (!showTooltip || slotProps?.tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
@@ -188,20 +187,16 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
188
187
|
/**
|
|
189
188
|
* The margin between the SVG and the drawing area.
|
|
190
189
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* bottom: 5,
|
|
195
|
-
* left: 5,
|
|
196
|
-
* right: 5,
|
|
197
|
-
* }
|
|
190
|
+
*
|
|
191
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
192
|
+
* @default 5
|
|
198
193
|
*/
|
|
199
|
-
margin: _propTypes.default.shape({
|
|
194
|
+
margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
200
195
|
bottom: _propTypes.default.number,
|
|
201
196
|
left: _propTypes.default.number,
|
|
202
197
|
right: _propTypes.default.number,
|
|
203
198
|
top: _propTypes.default.number
|
|
204
|
-
}),
|
|
199
|
+
})]),
|
|
205
200
|
/**
|
|
206
201
|
* The function called for onClick events.
|
|
207
202
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -278,6 +273,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
278
273
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
279
274
|
*/
|
|
280
275
|
xAxis: _propTypes.default.shape({
|
|
276
|
+
axis: _propTypes.default.oneOf(['x']),
|
|
281
277
|
classes: _propTypes.default.object,
|
|
282
278
|
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
283
279
|
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
@@ -300,13 +296,15 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
300
296
|
disableTicks: _propTypes.default.bool,
|
|
301
297
|
domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
|
|
302
298
|
fill: _propTypes.default.string,
|
|
299
|
+
height: _propTypes.default.number,
|
|
303
300
|
hideTooltip: _propTypes.default.bool,
|
|
304
301
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
305
302
|
label: _propTypes.default.string,
|
|
306
303
|
labelStyle: _propTypes.default.object,
|
|
307
304
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
308
305
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
309
|
-
|
|
306
|
+
offset: _propTypes.default.number,
|
|
307
|
+
position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
|
|
310
308
|
reverse: _propTypes.default.bool,
|
|
311
309
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
312
310
|
slotProps: _propTypes.default.object,
|
|
@@ -315,6 +313,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
315
313
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
316
314
|
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
317
315
|
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
316
|
+
tickLabelMinGap: _propTypes.default.number,
|
|
318
317
|
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
319
318
|
tickLabelStyle: _propTypes.default.object,
|
|
320
319
|
tickMaxStep: _propTypes.default.number,
|
|
@@ -329,6 +328,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
329
328
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
330
329
|
*/
|
|
331
330
|
yAxis: _propTypes.default.shape({
|
|
331
|
+
axis: _propTypes.default.oneOf(['y']),
|
|
332
332
|
classes: _propTypes.default.object,
|
|
333
333
|
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
334
334
|
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
@@ -357,7 +357,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
357
357
|
labelStyle: _propTypes.default.object,
|
|
358
358
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
359
359
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
360
|
-
|
|
360
|
+
offset: _propTypes.default.number,
|
|
361
|
+
position: _propTypes.default.oneOf(['left', 'none', 'right']),
|
|
361
362
|
reverse: _propTypes.default.bool,
|
|
362
363
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
363
364
|
slotProps: _propTypes.default.object,
|
|
@@ -373,6 +374,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
373
374
|
tickNumber: _propTypes.default.number,
|
|
374
375
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
375
376
|
tickSize: _propTypes.default.number,
|
|
376
|
-
valueFormatter: _propTypes.default.func
|
|
377
|
+
valueFormatter: _propTypes.default.func,
|
|
378
|
+
width: _propTypes.default.number
|
|
377
379
|
})
|
|
378
380
|
} : void 0;
|
package/constants/index.d.ts
CHANGED
|
@@ -6,4 +6,11 @@ export declare const DEFAULT_MARGINS: {
|
|
|
6
6
|
left: number;
|
|
7
7
|
right: number;
|
|
8
8
|
};
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const DEFAULT_AXIS_SIZE_WIDTH = 30;
|
|
10
|
+
export declare const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
11
|
+
export declare const EMPTY_SIDES: {
|
|
12
|
+
top: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
right: number;
|
|
16
|
+
};
|
package/constants/index.js
CHANGED
|
@@ -3,13 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DEFAULT_Y_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = exports.DEFAULT_MARGINS = exports.
|
|
6
|
+
exports.EMPTY_SIDES = exports.DEFAULT_Y_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = exports.DEFAULT_MARGINS = exports.DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_HEIGHT = void 0;
|
|
7
7
|
const DEFAULT_X_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY';
|
|
8
8
|
const DEFAULT_Y_AXIS_KEY = exports.DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY';
|
|
9
9
|
const DEFAULT_MARGINS = exports.DEFAULT_MARGINS = {
|
|
10
|
-
top:
|
|
11
|
-
bottom:
|
|
12
|
-
left:
|
|
13
|
-
right:
|
|
10
|
+
top: 20,
|
|
11
|
+
bottom: 20,
|
|
12
|
+
left: 20,
|
|
13
|
+
right: 20
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH = 30;
|
|
16
|
+
const DEFAULT_AXIS_SIZE_HEIGHT = exports.DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
17
|
+
const EMPTY_SIDES = exports.EMPTY_SIDES = {
|
|
18
|
+
top: 0,
|
|
19
|
+
bottom: 0,
|
|
20
|
+
left: 0,
|
|
21
|
+
right: 0
|
|
22
|
+
};
|
|
@@ -19,7 +19,7 @@ function useSkipAnimation(skipAnimation) {
|
|
|
19
19
|
data
|
|
20
20
|
} = React.useContext(_AnimationContext.AnimationContext);
|
|
21
21
|
if (!isInitialized) {
|
|
22
|
-
throw new Error(['MUI X: Could not find the animation ref context.', 'It looks like you rendered your component outside of a
|
|
22
|
+
throw new Error(['MUI X: Could not find the animation ref context.', 'It looks like you rendered your component outside of a ChartContainer parent component.'].join('\n'));
|
|
23
23
|
}
|
|
24
24
|
return skipAnimation || data.skipAnimation;
|
|
25
25
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins, MergeSignaturesProperty } from
|
|
3
|
-
import { ChartStore } from
|
|
4
|
-
import { ChartCorePluginSignatures } from
|
|
5
|
-
import { ChartSeriesConfig } from
|
|
6
|
-
import { UseChartBaseProps } from
|
|
7
|
-
import { ChartSeriesType } from
|
|
2
|
+
import type { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins, MergeSignaturesProperty } from '../../internals/plugins/models';
|
|
3
|
+
import type { ChartStore } from '../../internals/plugins/utils/ChartStore';
|
|
4
|
+
import type { ChartCorePluginSignatures } from '../../internals/plugins/corePlugins';
|
|
5
|
+
import type { ChartSeriesConfig } from '../../internals/plugins/models/seriesConfig';
|
|
6
|
+
import type { UseChartBaseProps } from '../../internals/store/useCharts.types';
|
|
7
|
+
import type { ChartSeriesType } from '../../models/seriesType/config';
|
|
8
8
|
export type ChartContextValue<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = {
|
|
9
9
|
/**
|
|
10
10
|
* And object with all the methods needed to interact with the chart.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DatasetType } from "../../models/seriesType/config.js";
|
|
2
2
|
import { AxisDefaultized, ScaleName, AxisId, AxisConfig, ChartsRotationAxisProps, ChartsRadiusAxisProps } from "../../models/axis.js";
|
|
3
|
+
import { ChartsAxisProps } from "../../ChartsAxis/index.js";
|
|
3
4
|
export type PolarProviderProps = {
|
|
4
5
|
/**
|
|
5
6
|
* The configuration of the rotation-axes.
|
|
@@ -16,10 +17,10 @@ export type PolarProviderProps = {
|
|
|
16
17
|
/**
|
|
17
18
|
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
18
19
|
*/
|
|
19
|
-
dataset?: DatasetType
|
|
20
|
+
dataset?: Readonly<DatasetType>;
|
|
20
21
|
children: React.ReactNode;
|
|
21
22
|
};
|
|
22
|
-
export type DefaultizedAxisConfig<Axis> = {
|
|
23
|
+
export type DefaultizedAxisConfig<Axis extends ChartsAxisProps> = {
|
|
23
24
|
[axisId: AxisId]: AxisDefaultized<ScaleName, any, Axis>;
|
|
24
25
|
};
|
|
25
26
|
export type PolarContextState = {
|
|
@@ -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
|
*/
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -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 {}
|