@mui/x-charts 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +10 -10
- package/BarChart/BarChart.mjs +10 -10
- package/BarChart/BarElement.d.mts +3 -2
- package/BarChart/BarElement.d.ts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.mts +3 -2
- package/BarChart/BarLabel/BarLabelItem.d.ts +3 -2
- package/BarChart/seriesConfig/bar/extremums.js +7 -2
- package/BarChart/seriesConfig/bar/extremums.mjs +7 -2
- package/BarChart/seriesConfig/bar/getColor.js +7 -53
- package/BarChart/seriesConfig/bar/getColor.mjs +7 -53
- package/BarChart/seriesConfig/bar/seriesProcessor.js +3 -1
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +3 -1
- package/BarChart/seriesConfig/bar/tooltip.js +4 -27
- package/BarChart/seriesConfig/bar/tooltip.mjs +4 -27
- package/CHANGELOG.md +314 -0
- package/ChartsContainer/ChartsContainer.js +30 -9
- package/ChartsContainer/ChartsContainer.mjs +30 -9
- package/ChartsLabel/ChartsLabelMark.js +1 -23
- package/ChartsLabel/ChartsLabelMark.mjs +0 -22
- package/ChartsLabel/labelMarkClasses.d.mts +0 -1
- package/ChartsLabel/labelMarkClasses.d.ts +0 -1
- package/ChartsLabel/labelMarkClasses.js +1 -2
- package/ChartsLabel/labelMarkClasses.mjs +2 -2
- package/ChartsLayerContainer/ChartsLayerContainer.js +36 -30
- package/ChartsLayerContainer/ChartsLayerContainer.mjs +36 -30
- package/ChartsLegend/chartsLegend.types.d.mts +3 -2
- package/ChartsLegend/chartsLegend.types.d.ts +3 -2
- package/ChartsLegend/piecewiseColorLegendClasses.js +8 -2
- package/ChartsLegend/piecewiseColorLegendClasses.mjs +8 -2
- package/ChartsOverlay/ChartsOverlay.d.mts +5 -4
- package/ChartsOverlay/ChartsOverlay.d.ts +5 -4
- package/ChartsReferenceLine/ChartsXReferenceLine.js +6 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.mjs +6 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.mjs +5 -0
- package/ChartsTooltip/ChartTooltip.types.d.mts +3 -2
- package/ChartsTooltip/ChartTooltip.types.d.ts +3 -2
- package/ChartsTooltip/useAxesTooltip.js +2 -2
- package/ChartsTooltip/useAxesTooltip.mjs +2 -2
- package/ChartsTooltip/useItemTooltip.js +2 -2
- package/ChartsTooltip/useItemTooltip.mjs +2 -2
- package/ChartsXAxis/ChartsXAxis.js +3 -1
- package/ChartsXAxis/ChartsXAxis.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsXAxis/useAxisTicksProps.d.ts +84 -3
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/ChartsYAxis/ChartsYAxis.mjs +3 -1
- package/ChartsYAxis/useAxisTicksProps.d.mts +84 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +84 -3
- package/LineChart/AreaElement.d.mts +3 -2
- package/LineChart/AreaElement.d.ts +3 -2
- package/LineChart/LineChart.js +6 -6
- package/LineChart/LineChart.mjs +6 -6
- package/LineChart/LineElement.d.mts +3 -2
- package/LineChart/LineElement.d.ts +3 -2
- package/LineChart/LineHighlightPlot.d.mts +3 -2
- package/LineChart/LineHighlightPlot.d.ts +3 -2
- package/LineChart/LineHighlightPlot.js +65 -45
- package/LineChart/LineHighlightPlot.mjs +65 -45
- package/LineChart/MarkPlot.d.mts +3 -2
- package/LineChart/MarkPlot.d.ts +3 -2
- package/LineChart/seriesConfig/curveEvaluation.js +40 -15
- package/LineChart/seriesConfig/curveEvaluation.mjs +39 -15
- package/LineChart/seriesConfig/extremums.js +5 -1
- package/LineChart/seriesConfig/extremums.mjs +5 -1
- package/LineChart/seriesConfig/getColor.js +7 -54
- package/LineChart/seriesConfig/getColor.mjs +7 -54
- package/LineChart/seriesConfig/seriesProcessor.d.mts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.d.ts +2 -4
- package/LineChart/seriesConfig/seriesProcessor.js +2 -139
- package/LineChart/seriesConfig/seriesProcessor.mjs +2 -138
- package/LineChart/seriesConfig/tooltip.js +4 -25
- package/LineChart/seriesConfig/tooltip.mjs +4 -25
- package/LineChart/useMarkPlotData.js +3 -1
- package/LineChart/useMarkPlotData.mjs +3 -1
- package/PieChart/PieArcLabelPlot.d.mts +3 -2
- package/PieChart/PieArcLabelPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/PieChart/PieChart.js +6 -6
- package/PieChart/PieChart.mjs +6 -6
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +2 -2
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/RadarChart/RadarAxis/useRadarAxis.js +1 -1
- package/RadarChart/RadarAxis/useRadarAxis.mjs +1 -1
- package/RadarChart/RadarChart.js +8 -8
- package/RadarChart/RadarChart.mjs +8 -8
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +1 -0
- package/ScatterChart/BatchScatter.d.mts +2 -8
- package/ScatterChart/BatchScatter.d.ts +2 -8
- package/ScatterChart/BatchScatter.js +17 -12
- package/ScatterChart/BatchScatter.mjs +17 -12
- package/ScatterChart/FocusedScatterMark.js +2 -2
- package/ScatterChart/FocusedScatterMark.mjs +2 -2
- package/ScatterChart/HighlightedScatterMark.js +3 -3
- package/ScatterChart/HighlightedScatterMark.mjs +3 -3
- package/ScatterChart/Scatter.d.mts +5 -0
- package/ScatterChart/Scatter.d.ts +5 -0
- package/ScatterChart/Scatter.js +7 -2
- package/ScatterChart/Scatter.mjs +7 -2
- package/ScatterChart/ScatterChart.d.mts +2 -1
- package/ScatterChart/ScatterChart.d.ts +2 -1
- package/ScatterChart/ScatterChart.js +32 -11
- package/ScatterChart/ScatterChart.mjs +32 -11
- package/ScatterChart/ScatterMarker.types.d.mts +3 -2
- package/ScatterChart/ScatterMarker.types.d.ts +3 -2
- package/ScatterChart/ScatterPlot.d.mts +3 -2
- package/ScatterChart/ScatterPlot.d.ts +3 -2
- package/ScatterChart/ScatterPlot.js +6 -1
- package/ScatterChart/ScatterPlot.mjs +6 -1
- package/ScatterChart/seriesConfig/extremums.js +6 -0
- package/ScatterChart/seriesConfig/extremums.mjs +6 -0
- package/ScatterChart/seriesConfig/getColor.js +1 -1
- package/ScatterChart/seriesConfig/getColor.mjs +1 -1
- package/ScatterChart/seriesConfig/getMarkerSize.d.mts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.d.ts +18 -0
- package/ScatterChart/seriesConfig/getMarkerSize.js +43 -0
- package/ScatterChart/seriesConfig/getMarkerSize.mjs +37 -0
- package/ScatterChart/seriesConfig/seriesProcessor.js +23 -8
- package/ScatterChart/seriesConfig/seriesProcessor.mjs +23 -8
- package/ScatterChart/seriesConfig/tooltip.js +2 -24
- package/ScatterChart/seriesConfig/tooltip.mjs +2 -24
- package/ScatterChart/useScatterItemPosition.d.mts +4 -0
- package/ScatterChart/useScatterItemPosition.d.ts +4 -0
- package/ScatterChart/useScatterItemPosition.js +9 -0
- package/ScatterChart/useScatterItemPosition.mjs +8 -0
- package/SparkLineChart/SparkLineChart.js +27 -27
- package/SparkLineChart/SparkLineChart.mjs +27 -27
- package/Toolbar/Toolbar.types.d.mts +3 -2
- package/Toolbar/Toolbar.types.d.ts +3 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -2
- package/internals/animation/animation.d.ts +1 -2
- package/internals/commonNextFocusItem.d.mts +10 -2
- package/internals/commonNextFocusItem.d.ts +10 -2
- package/internals/commonNextFocusItem.js +12 -4
- package/internals/commonNextFocusItem.mjs +12 -4
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +1 -1
- package/internals/createCommonKeyboardFocusHandler.js +3 -3
- package/internals/createCommonKeyboardFocusHandler.mjs +3 -3
- package/internals/getLineLikeTooltip.d.mts +9 -0
- package/internals/getLineLikeTooltip.d.ts +9 -0
- package/internals/getLineLikeTooltip.js +38 -0
- package/internals/getLineLikeTooltip.mjs +31 -0
- package/internals/incompleteDatasetKeysError.d.mts +1 -0
- package/internals/incompleteDatasetKeysError.d.ts +1 -0
- package/internals/incompleteDatasetKeysError.js +11 -0
- package/internals/incompleteDatasetKeysError.mjs +4 -0
- package/internals/index.d.mts +5 -0
- package/internals/index.d.ts +5 -0
- package/internals/index.js +48 -0
- package/internals/index.mjs +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.mjs +4 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.mts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +10 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.mjs +16 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +24 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +24 -5
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +46 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.mjs +47 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +46 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +6 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +6 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.mts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +3 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +5 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +7 -5
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +17 -3
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.mjs +17 -3
- package/internals/processLineLikeSeries.d.mts +6 -0
- package/internals/processLineLikeSeries.d.ts +6 -0
- package/internals/processLineLikeSeries.js +145 -0
- package/internals/processLineLikeSeries.mjs +138 -0
- package/internals/resolveColorProcessor.d.mts +11 -0
- package/internals/resolveColorProcessor.d.ts +11 -0
- package/internals/resolveColorProcessor.js +62 -0
- package/internals/resolveColorProcessor.mjs +56 -0
- package/internals/sizeScale.d.mts +6 -0
- package/internals/sizeScale.d.ts +6 -0
- package/internals/sizeScale.js +46 -0
- package/internals/sizeScale.mjs +38 -0
- package/models/axis.d.mts +18 -12
- package/models/axis.d.ts +18 -12
- package/models/chartsSlotsComponentsProps.d.mts +25 -0
- package/models/chartsSlotsComponentsProps.d.ts +25 -0
- package/models/chartsSlotsComponentsProps.js +5 -0
- package/models/chartsSlotsComponentsProps.mjs +1 -0
- package/models/index.d.mts +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/models/index.mjs +1 -0
- package/models/seriesType/line.d.mts +5 -2
- package/models/seriesType/line.d.ts +5 -2
- package/models/seriesType/scatter.d.mts +34 -2
- package/models/seriesType/scatter.d.ts +34 -2
- package/models/sizeMapping.d.mts +64 -0
- package/models/sizeMapping.d.ts +64 -0
- package/models/sizeMapping.js +5 -0
- package/models/sizeMapping.mjs +1 -0
- package/models/slots/chartsBaseSlots.d.mts +6 -5
- package/models/slots/chartsBaseSlots.d.ts +6 -5
- package/models/z-axis.d.mts +10 -1
- package/models/z-axis.d.ts +10 -1
- package/package.json +6 -6
package/BarChart/BarChart.js
CHANGED
|
@@ -172,11 +172,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
172
172
|
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
173
173
|
dataIndex: _propTypes.default.number,
|
|
174
174
|
seriesId: _propTypes.default.string.isRequired,
|
|
175
|
-
type: _propTypes.default.oneOf(['bar'])
|
|
175
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
176
176
|
}), _propTypes.default.shape({
|
|
177
177
|
dataIndex: _propTypes.default.number,
|
|
178
178
|
seriesId: _propTypes.default.string.isRequired,
|
|
179
|
-
type: _propTypes.default.oneOf(['bar'])
|
|
179
|
+
type: _propTypes.default.oneOf(['bar'])
|
|
180
180
|
})]).isRequired),
|
|
181
181
|
/**
|
|
182
182
|
* If `true`, the legend is not rendered.
|
|
@@ -196,11 +196,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
196
196
|
*/
|
|
197
197
|
highlightedItem: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
198
198
|
dataIndex: _propTypes.default.number,
|
|
199
|
-
seriesId: _propTypes.default.string.isRequired
|
|
200
|
-
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
199
|
+
seriesId: _propTypes.default.string.isRequired
|
|
201
200
|
}), _propTypes.default.shape({
|
|
202
201
|
dataIndex: _propTypes.default.number,
|
|
203
|
-
seriesId: _propTypes.default.string.isRequired
|
|
202
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
203
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
204
204
|
})]),
|
|
205
205
|
/**
|
|
206
206
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -231,11 +231,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
231
231
|
initialHiddenItems: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
232
232
|
dataIndex: _propTypes.default.number,
|
|
233
233
|
seriesId: _propTypes.default.string.isRequired,
|
|
234
|
-
type: _propTypes.default.oneOf(['bar'])
|
|
234
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
235
235
|
}), _propTypes.default.shape({
|
|
236
236
|
dataIndex: _propTypes.default.number,
|
|
237
237
|
seriesId: _propTypes.default.string.isRequired,
|
|
238
|
-
type: _propTypes.default.oneOf(['bar'])
|
|
238
|
+
type: _propTypes.default.oneOf(['bar'])
|
|
239
239
|
})]).isRequired),
|
|
240
240
|
/**
|
|
241
241
|
* The direction of the bar elements.
|
|
@@ -365,11 +365,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
365
365
|
*/
|
|
366
366
|
tooltipItem: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
367
367
|
dataIndex: _propTypes.default.number.isRequired,
|
|
368
|
-
seriesId: _propTypes.default.string.isRequired
|
|
369
|
-
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
368
|
+
seriesId: _propTypes.default.string.isRequired
|
|
370
369
|
}), _propTypes.default.shape({
|
|
371
370
|
dataIndex: _propTypes.default.number.isRequired,
|
|
372
|
-
seriesId: _propTypes.default.string.isRequired
|
|
371
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
372
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
373
373
|
})]),
|
|
374
374
|
/**
|
|
375
375
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
package/BarChart/BarChart.mjs
CHANGED
|
@@ -165,11 +165,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
165
165
|
hiddenItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
166
166
|
dataIndex: PropTypes.number,
|
|
167
167
|
seriesId: PropTypes.string.isRequired,
|
|
168
|
-
type: PropTypes.oneOf(['bar'])
|
|
168
|
+
type: PropTypes.oneOf(['bar']).isRequired
|
|
169
169
|
}), PropTypes.shape({
|
|
170
170
|
dataIndex: PropTypes.number,
|
|
171
171
|
seriesId: PropTypes.string.isRequired,
|
|
172
|
-
type: PropTypes.oneOf(['bar'])
|
|
172
|
+
type: PropTypes.oneOf(['bar'])
|
|
173
173
|
})]).isRequired),
|
|
174
174
|
/**
|
|
175
175
|
* If `true`, the legend is not rendered.
|
|
@@ -189,11 +189,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
189
189
|
*/
|
|
190
190
|
highlightedItem: PropTypes.oneOfType([PropTypes.shape({
|
|
191
191
|
dataIndex: PropTypes.number,
|
|
192
|
-
seriesId: PropTypes.string.isRequired
|
|
193
|
-
type: PropTypes.oneOf(['bar']).isRequired
|
|
192
|
+
seriesId: PropTypes.string.isRequired
|
|
194
193
|
}), PropTypes.shape({
|
|
195
194
|
dataIndex: PropTypes.number,
|
|
196
|
-
seriesId: PropTypes.string.isRequired
|
|
195
|
+
seriesId: PropTypes.string.isRequired,
|
|
196
|
+
type: PropTypes.oneOf(['bar']).isRequired
|
|
197
197
|
})]),
|
|
198
198
|
/**
|
|
199
199
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -224,11 +224,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
224
224
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
225
225
|
dataIndex: PropTypes.number,
|
|
226
226
|
seriesId: PropTypes.string.isRequired,
|
|
227
|
-
type: PropTypes.oneOf(['bar'])
|
|
227
|
+
type: PropTypes.oneOf(['bar']).isRequired
|
|
228
228
|
}), PropTypes.shape({
|
|
229
229
|
dataIndex: PropTypes.number,
|
|
230
230
|
seriesId: PropTypes.string.isRequired,
|
|
231
|
-
type: PropTypes.oneOf(['bar'])
|
|
231
|
+
type: PropTypes.oneOf(['bar'])
|
|
232
232
|
})]).isRequired),
|
|
233
233
|
/**
|
|
234
234
|
* The direction of the bar elements.
|
|
@@ -358,11 +358,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
358
358
|
*/
|
|
359
359
|
tooltipItem: PropTypes.oneOfType([PropTypes.shape({
|
|
360
360
|
dataIndex: PropTypes.number.isRequired,
|
|
361
|
-
seriesId: PropTypes.string.isRequired
|
|
362
|
-
type: PropTypes.oneOf(['bar']).isRequired
|
|
361
|
+
seriesId: PropTypes.string.isRequired
|
|
363
362
|
}), PropTypes.shape({
|
|
364
363
|
dataIndex: PropTypes.number.isRequired,
|
|
365
|
-
seriesId: PropTypes.string.isRequired
|
|
364
|
+
seriesId: PropTypes.string.isRequired,
|
|
365
|
+
type: PropTypes.oneOf(['bar']).isRequired
|
|
366
366
|
})]),
|
|
367
367
|
/**
|
|
368
368
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
@@ -2,15 +2,16 @@ import * as React from 'react';
|
|
|
2
2
|
import { type SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
3
3
|
import { type BarElementOwnerState } from "./barClasses.mjs";
|
|
4
4
|
import { type BarProps } from "./AnimatedBarElement.mjs";
|
|
5
|
+
import type { BarPropsOverrides } from "../models/chartsSlotsComponentsProps.mjs";
|
|
5
6
|
export interface BarElementSlots {
|
|
6
7
|
/**
|
|
7
8
|
* The component that renders the bar.
|
|
8
9
|
* @default BarElementPath
|
|
9
10
|
*/
|
|
10
|
-
bar?: React.JSXElementConstructor<BarProps>;
|
|
11
|
+
bar?: React.JSXElementConstructor<BarProps & BarPropsOverrides>;
|
|
11
12
|
}
|
|
12
13
|
export interface BarElementSlotProps {
|
|
13
|
-
bar?: SlotComponentPropsFromProps<BarProps,
|
|
14
|
+
bar?: SlotComponentPropsFromProps<BarProps, BarPropsOverrides, BarElementOwnerState>;
|
|
14
15
|
}
|
|
15
16
|
export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted' | 'isFocused'> & Omit<React.SVGProps<SVGRectElement>, 'ref'> & {
|
|
16
17
|
/**
|
package/BarChart/BarElement.d.ts
CHANGED
|
@@ -2,15 +2,16 @@ import * as React from 'react';
|
|
|
2
2
|
import { type SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
3
3
|
import { type BarElementOwnerState } from "./barClasses.js";
|
|
4
4
|
import { type BarProps } from "./AnimatedBarElement.js";
|
|
5
|
+
import type { BarPropsOverrides } from "../models/chartsSlotsComponentsProps.js";
|
|
5
6
|
export interface BarElementSlots {
|
|
6
7
|
/**
|
|
7
8
|
* The component that renders the bar.
|
|
8
9
|
* @default BarElementPath
|
|
9
10
|
*/
|
|
10
|
-
bar?: React.JSXElementConstructor<BarProps>;
|
|
11
|
+
bar?: React.JSXElementConstructor<BarProps & BarPropsOverrides>;
|
|
11
12
|
}
|
|
12
13
|
export interface BarElementSlotProps {
|
|
13
|
-
bar?: SlotComponentPropsFromProps<BarProps,
|
|
14
|
+
bar?: SlotComponentPropsFromProps<BarProps, BarPropsOverrides, BarElementOwnerState>;
|
|
14
15
|
}
|
|
15
16
|
export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted' | 'isFocused'> & Omit<React.SVGProps<SVGRectElement>, 'ref'> & {
|
|
16
17
|
/**
|
|
@@ -3,15 +3,16 @@ import { type SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
|
3
3
|
import { type BarLabelOwnerState, type BarItem, type BarLabelContext } from "./BarLabel.types.mjs";
|
|
4
4
|
import { type BarLabelProps } from "./BarLabel.mjs";
|
|
5
5
|
import { type BarValueType } from "../../models/index.mjs";
|
|
6
|
+
import type { BarLabelPropsOverrides } from "../../models/chartsSlotsComponentsProps.mjs";
|
|
6
7
|
export interface BarLabelSlots {
|
|
7
8
|
/**
|
|
8
9
|
* The component that renders the bar label.
|
|
9
10
|
* @default BarLabel
|
|
10
11
|
*/
|
|
11
|
-
barLabel?: React.JSXElementConstructor<BarLabelProps>;
|
|
12
|
+
barLabel?: React.JSXElementConstructor<BarLabelProps & BarLabelPropsOverrides>;
|
|
12
13
|
}
|
|
13
14
|
export interface BarLabelSlotProps {
|
|
14
|
-
barLabel?: SlotComponentPropsFromProps<BarLabelProps,
|
|
15
|
+
barLabel?: SlotComponentPropsFromProps<BarLabelProps, BarLabelPropsOverrides, BarLabelOwnerState>;
|
|
15
16
|
}
|
|
16
17
|
export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwnerState, 'isFaded' | 'isHighlighted'> & Pick<BarLabelProps, 'style'> & {
|
|
17
18
|
/**
|
|
@@ -3,15 +3,16 @@ import { type SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
|
3
3
|
import { type BarLabelOwnerState, type BarItem, type BarLabelContext } from "./BarLabel.types.js";
|
|
4
4
|
import { type BarLabelProps } from "./BarLabel.js";
|
|
5
5
|
import { type BarValueType } from "../../models/index.js";
|
|
6
|
+
import type { BarLabelPropsOverrides } from "../../models/chartsSlotsComponentsProps.js";
|
|
6
7
|
export interface BarLabelSlots {
|
|
7
8
|
/**
|
|
8
9
|
* The component that renders the bar label.
|
|
9
10
|
* @default BarLabel
|
|
10
11
|
*/
|
|
11
|
-
barLabel?: React.JSXElementConstructor<BarLabelProps>;
|
|
12
|
+
barLabel?: React.JSXElementConstructor<BarLabelProps & BarLabelPropsOverrides>;
|
|
12
13
|
}
|
|
13
14
|
export interface BarLabelSlotProps {
|
|
14
|
-
barLabel?: SlotComponentPropsFromProps<BarLabelProps,
|
|
15
|
+
barLabel?: SlotComponentPropsFromProps<BarLabelProps, BarLabelPropsOverrides, BarLabelOwnerState>;
|
|
15
16
|
}
|
|
16
17
|
export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwnerState, 'isFaded' | 'isHighlighted'> & Pick<BarLabelProps, 'style'> & {
|
|
17
18
|
/**
|
|
@@ -42,10 +42,14 @@ const getValueExtremum = direction => params => {
|
|
|
42
42
|
} = params;
|
|
43
43
|
return Object.keys(series).filter(seriesId => {
|
|
44
44
|
const axisId = direction === 'x' ? series[seriesId].xAxisId : series[seriesId].yAxisId;
|
|
45
|
+
if (axis.domainSeries === 'visible' && series[seriesId].hidden) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
45
48
|
return axisId === axis.id || isDefaultAxis && axisId === undefined;
|
|
46
49
|
}).reduce((acc, seriesId) => {
|
|
47
50
|
const {
|
|
48
|
-
stackedData
|
|
51
|
+
stackedData,
|
|
52
|
+
visibleStackedData
|
|
49
53
|
} = series[seriesId];
|
|
50
54
|
const filter = getFilters?.({
|
|
51
55
|
currentAxisId: axis.id,
|
|
@@ -53,7 +57,8 @@ const getValueExtremum = direction => params => {
|
|
|
53
57
|
seriesXAxisId: series[seriesId].xAxisId,
|
|
54
58
|
seriesYAxisId: series[seriesId].yAxisId
|
|
55
59
|
});
|
|
56
|
-
const
|
|
60
|
+
const stackedDataToUse = axis.domainSeries === 'visible' ? visibleStackedData : stackedData;
|
|
61
|
+
const [seriesMin, seriesMax] = stackedDataToUse?.reduce((seriesAcc, values, index) => {
|
|
57
62
|
if (filter && (!filter(createResult(values[0], direction), index) || !filter(createResult(values[1], direction), index))) {
|
|
58
63
|
return seriesAcc;
|
|
59
64
|
}
|
|
@@ -36,10 +36,14 @@ const getValueExtremum = direction => params => {
|
|
|
36
36
|
} = params;
|
|
37
37
|
return Object.keys(series).filter(seriesId => {
|
|
38
38
|
const axisId = direction === 'x' ? series[seriesId].xAxisId : series[seriesId].yAxisId;
|
|
39
|
+
if (axis.domainSeries === 'visible' && series[seriesId].hidden) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
39
42
|
return axisId === axis.id || isDefaultAxis && axisId === undefined;
|
|
40
43
|
}).reduce((acc, seriesId) => {
|
|
41
44
|
const {
|
|
42
|
-
stackedData
|
|
45
|
+
stackedData,
|
|
46
|
+
visibleStackedData
|
|
43
47
|
} = series[seriesId];
|
|
44
48
|
const filter = getFilters?.({
|
|
45
49
|
currentAxisId: axis.id,
|
|
@@ -47,7 +51,8 @@ const getValueExtremum = direction => params => {
|
|
|
47
51
|
seriesXAxisId: series[seriesId].xAxisId,
|
|
48
52
|
seriesYAxisId: series[seriesId].yAxisId
|
|
49
53
|
});
|
|
50
|
-
const
|
|
54
|
+
const stackedDataToUse = axis.domainSeries === 'visible' ? visibleStackedData : stackedData;
|
|
55
|
+
const [seriesMin, seriesMax] = stackedDataToUse?.reduce((seriesAcc, values, index) => {
|
|
51
56
|
if (filter && (!filter(createResult(values[0], direction), index) || !filter(createResult(values[1], direction), index))) {
|
|
52
57
|
return seriesAcc;
|
|
53
58
|
}
|
|
@@ -4,60 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _resolveColorProcessor = require("../../../internals/resolveColorProcessor");
|
|
8
8
|
const getColor = (series, xAxis, yAxis) => {
|
|
9
9
|
const verticalLayout = series.layout === 'vertical';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (dataIndex === undefined) {
|
|
17
|
-
return series.color;
|
|
18
|
-
}
|
|
19
|
-
const value = series.data[dataIndex];
|
|
20
|
-
const color = value === null ? getSeriesColor({
|
|
21
|
-
value,
|
|
22
|
-
dataIndex
|
|
23
|
-
}) : valueColorScale(value);
|
|
24
|
-
if (color === null) {
|
|
25
|
-
return getSeriesColor({
|
|
26
|
-
value,
|
|
27
|
-
dataIndex
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return color;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
if (bandColorScale && bandValues) {
|
|
34
|
-
return dataIndex => {
|
|
35
|
-
if (dataIndex === undefined) {
|
|
36
|
-
return series.color;
|
|
37
|
-
}
|
|
38
|
-
const value = bandValues[dataIndex];
|
|
39
|
-
const color = value === null ? getSeriesColor({
|
|
40
|
-
value,
|
|
41
|
-
dataIndex
|
|
42
|
-
}) : bandColorScale(value);
|
|
43
|
-
if (color === null) {
|
|
44
|
-
return getSeriesColor({
|
|
45
|
-
value,
|
|
46
|
-
dataIndex
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return color;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return dataIndex => {
|
|
53
|
-
if (dataIndex === undefined) {
|
|
54
|
-
return series.color;
|
|
55
|
-
}
|
|
56
|
-
const value = series.data[dataIndex];
|
|
57
|
-
return getSeriesColor({
|
|
58
|
-
value,
|
|
59
|
-
dataIndex
|
|
60
|
-
});
|
|
61
|
-
};
|
|
10
|
+
return (0, _resolveColorProcessor.resolveColorProcessor)({
|
|
11
|
+
series,
|
|
12
|
+
valueColorScale: verticalLayout ? yAxis?.colorScale : xAxis?.colorScale,
|
|
13
|
+
categoryColorScale: verticalLayout ? xAxis?.colorScale : yAxis?.colorScale,
|
|
14
|
+
categoryValues: verticalLayout ? xAxis?.data : yAxis?.data
|
|
15
|
+
});
|
|
62
16
|
};
|
|
63
17
|
var _default = exports.default = getColor;
|
|
@@ -1,57 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveColorProcessor } from "../../../internals/resolveColorProcessor.mjs";
|
|
2
2
|
const getColor = (series, xAxis, yAxis) => {
|
|
3
3
|
const verticalLayout = series.layout === 'vertical';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (dataIndex === undefined) {
|
|
11
|
-
return series.color;
|
|
12
|
-
}
|
|
13
|
-
const value = series.data[dataIndex];
|
|
14
|
-
const color = value === null ? getSeriesColor({
|
|
15
|
-
value,
|
|
16
|
-
dataIndex
|
|
17
|
-
}) : valueColorScale(value);
|
|
18
|
-
if (color === null) {
|
|
19
|
-
return getSeriesColor({
|
|
20
|
-
value,
|
|
21
|
-
dataIndex
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return color;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (bandColorScale && bandValues) {
|
|
28
|
-
return dataIndex => {
|
|
29
|
-
if (dataIndex === undefined) {
|
|
30
|
-
return series.color;
|
|
31
|
-
}
|
|
32
|
-
const value = bandValues[dataIndex];
|
|
33
|
-
const color = value === null ? getSeriesColor({
|
|
34
|
-
value,
|
|
35
|
-
dataIndex
|
|
36
|
-
}) : bandColorScale(value);
|
|
37
|
-
if (color === null) {
|
|
38
|
-
return getSeriesColor({
|
|
39
|
-
value,
|
|
40
|
-
dataIndex
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return color;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return dataIndex => {
|
|
47
|
-
if (dataIndex === undefined) {
|
|
48
|
-
return series.color;
|
|
49
|
-
}
|
|
50
|
-
const value = series.data[dataIndex];
|
|
51
|
-
return getSeriesColor({
|
|
52
|
-
value,
|
|
53
|
-
dataIndex
|
|
54
|
-
});
|
|
55
|
-
};
|
|
4
|
+
return resolveColorProcessor({
|
|
5
|
+
series,
|
|
6
|
+
valueColorScale: verticalLayout ? yAxis?.colorScale : xAxis?.colorScale,
|
|
7
|
+
categoryColorScale: verticalLayout ? xAxis?.colorScale : yAxis?.colorScale,
|
|
8
|
+
categoryValues: verticalLayout ? xAxis?.data : yAxis?.data
|
|
9
|
+
});
|
|
56
10
|
};
|
|
57
11
|
export default getColor;
|
|
@@ -44,7 +44,9 @@ const seriesProcessor = (params, dataset, isItemVisible) => {
|
|
|
44
44
|
d3Dataset[index][id] = value;
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
} else if (dataset === undefined) {
|
|
47
|
+
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
48
|
+
// TODO: fix mui/no-guarded-throw
|
|
49
|
+
// eslint-disable-next-line mui/no-guarded-throw
|
|
48
50
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Bar series with id="${id}" has no data. ` + 'The chart cannot render this series without data. ' + 'Provide a data property to the series or use the dataset prop.' : (0, _formatErrorMessage2.default)(33, id));
|
|
49
51
|
}
|
|
50
52
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -37,7 +37,9 @@ const seriesProcessor = (params, dataset, isItemVisible) => {
|
|
|
37
37
|
d3Dataset[index][id] = value;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
} else if (dataset === undefined) {
|
|
40
|
+
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
41
|
+
// TODO: fix mui/no-guarded-throw
|
|
42
|
+
// eslint-disable-next-line mui/no-guarded-throw
|
|
41
43
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Bar series with id="${id}" has no data. ` + 'The chart cannot render this series without data. ' + 'Provide a data property to the series or use the dataset prop.' : _formatErrorMessage(33, id));
|
|
42
44
|
}
|
|
43
45
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4,33 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.axisTooltipGetter = void 0;
|
|
7
|
-
var
|
|
8
|
-
const tooltipGetter = params => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
getColor,
|
|
12
|
-
identifier
|
|
13
|
-
} = params;
|
|
14
|
-
if (!identifier || identifier.dataIndex === undefined) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const label = (0, _getLabel.getLabel)(series.label, 'tooltip');
|
|
18
|
-
const value = series.data[identifier.dataIndex];
|
|
19
|
-
if (value == null) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const formattedValue = series.valueFormatter(value, {
|
|
23
|
-
dataIndex: identifier.dataIndex
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
identifier,
|
|
27
|
-
color: getColor(identifier.dataIndex),
|
|
28
|
-
label,
|
|
29
|
-
value,
|
|
30
|
-
formattedValue,
|
|
31
|
-
markType: series.labelMarkType
|
|
32
|
-
};
|
|
33
|
-
};
|
|
7
|
+
var _getLineLikeTooltip = require("../../../internals/getLineLikeTooltip");
|
|
8
|
+
const tooltipGetter = params => (0, _getLineLikeTooltip.getLineLikeTooltip)(params, {
|
|
9
|
+
skipNullValues: true
|
|
10
|
+
});
|
|
34
11
|
const axisTooltipGetter = series => {
|
|
35
12
|
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
36
13
|
direction: 'y',
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const tooltipGetter = params => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
getColor,
|
|
6
|
-
identifier
|
|
7
|
-
} = params;
|
|
8
|
-
if (!identifier || identifier.dataIndex === undefined) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
const label = getLabel(series.label, 'tooltip');
|
|
12
|
-
const value = series.data[identifier.dataIndex];
|
|
13
|
-
if (value == null) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const formattedValue = series.valueFormatter(value, {
|
|
17
|
-
dataIndex: identifier.dataIndex
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
identifier,
|
|
21
|
-
color: getColor(identifier.dataIndex),
|
|
22
|
-
label,
|
|
23
|
-
value,
|
|
24
|
-
formattedValue,
|
|
25
|
-
markType: series.labelMarkType
|
|
26
|
-
};
|
|
27
|
-
};
|
|
1
|
+
import { getLineLikeTooltip } from "../../../internals/getLineLikeTooltip.mjs";
|
|
2
|
+
const tooltipGetter = params => getLineLikeTooltip(params, {
|
|
3
|
+
skipNullValues: true
|
|
4
|
+
});
|
|
28
5
|
export const axisTooltipGetter = series => {
|
|
29
6
|
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
30
7
|
direction: 'y',
|