@mui/x-charts 8.19.0 → 8.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +1 -1
- package/BarChart/BarChart.js +18 -0
- package/BarChart/BarLabel/BarLabel.types.d.ts +4 -3
- package/BarChart/BarLabel/BarLabelItem.d.ts +5 -4
- package/BarChart/BarLabel/BarLabelPlot.d.ts +25 -6
- package/BarChart/BarLabel/BarLabelPlot.js +10 -9
- package/BarChart/BarLabel/getBarLabel.d.ts +5 -4
- package/BarChart/BarLabel/getBarLabel.js +3 -4
- package/BarChart/BarPlot.js +4 -3
- package/BarChart/checkBarChartScaleErrors.d.ts +7 -0
- package/BarChart/{checkScaleErrors.js → checkBarChartScaleErrors.js} +6 -7
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +5 -3
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.js +3 -4
- package/BarChart/seriesConfig/index.js +2 -2
- package/BarChart/types.d.ts +6 -3
- package/BarChart/useBarPlotData.js +17 -45
- package/CHANGELOG.md +174 -0
- package/ChartContainer/ChartContainer.js +28 -0
- package/ChartsGrid/ChartsHorizontalGrid.js +8 -2
- package/ChartsGrid/ChartsVerticalGrid.js +8 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +2 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.js +2 -0
- package/ChartsXAxis/ChartsXAxisImpl.js +2 -0
- package/ChartsXAxis/useAxisTicksProps.d.ts +198 -117
- package/ChartsXAxis/useAxisTicksProps.js +2 -0
- package/ChartsYAxis/ChartsSingleYAxisTicks.js +2 -0
- package/ChartsYAxis/ChartsYAxisImpl.js +2 -0
- package/ChartsYAxis/useAxisTicksProps.d.ts +198 -117
- package/ChartsYAxis/useAxisTicksProps.js +2 -0
- package/LineChart/LineChart.js +18 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +2 -2
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.ts +7 -0
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.js +26 -0
- package/RadarChart/seriesConfig/index.js +2 -0
- package/RadarChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/RadarChart/seriesConfig/tooltipPosition.js +80 -0
- package/ScatterChart/ScatterChart.js +18 -0
- package/SparkLineChart/SparkLineChart.js +18 -0
- package/esm/BarChart/BarChart.d.ts +1 -1
- package/esm/BarChart/BarChart.js +18 -0
- package/esm/BarChart/BarLabel/BarLabel.types.d.ts +4 -3
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +5 -4
- package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +25 -6
- package/esm/BarChart/BarLabel/BarLabelPlot.js +9 -9
- package/esm/BarChart/BarLabel/getBarLabel.d.ts +5 -4
- package/esm/BarChart/BarLabel/getBarLabel.js +2 -2
- package/esm/BarChart/BarPlot.js +4 -3
- package/esm/BarChart/checkBarChartScaleErrors.d.ts +7 -0
- package/esm/BarChart/{checkScaleErrors.js → checkBarChartScaleErrors.js} +5 -6
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +5 -3
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.js +2 -3
- package/esm/BarChart/seriesConfig/index.js +1 -1
- package/esm/BarChart/types.d.ts +6 -3
- package/esm/BarChart/useBarPlotData.js +17 -45
- package/esm/ChartContainer/ChartContainer.js +28 -0
- package/esm/ChartsGrid/ChartsHorizontalGrid.js +8 -2
- package/esm/ChartsGrid/ChartsVerticalGrid.js +8 -2
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +2 -1
- package/esm/ChartsXAxis/ChartsSingleXAxisTicks.js +2 -0
- package/esm/ChartsXAxis/ChartsXAxisImpl.js +2 -0
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +198 -117
- package/esm/ChartsXAxis/useAxisTicksProps.js +2 -0
- package/esm/ChartsYAxis/ChartsSingleYAxisTicks.js +2 -0
- package/esm/ChartsYAxis/ChartsYAxisImpl.js +2 -0
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +198 -117
- package/esm/ChartsYAxis/useAxisTicksProps.js +2 -0
- package/esm/LineChart/LineChart.js +18 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +1 -1
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -1
- package/esm/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.ts +7 -0
- package/esm/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.js +18 -0
- package/esm/RadarChart/seriesConfig/index.js +2 -0
- package/esm/RadarChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/tooltipPosition.js +74 -0
- package/esm/ScatterChart/ScatterChart.js +18 -0
- package/esm/SparkLineChart/SparkLineChart.js +18 -0
- package/esm/hooks/useInteractionItemProps.d.ts +0 -5
- package/esm/hooks/useInteractionItemProps.js +0 -11
- package/esm/hooks/useIsHydrated.js +1 -1
- package/esm/hooks/useTicks.d.ts +15 -2
- package/esm/hooks/useTicks.js +44 -6
- package/esm/index.js +1 -1
- package/esm/internals/domUtils.d.ts +6 -3
- package/esm/internals/getBandSize.d.ts +13 -0
- package/esm/internals/getBandSize.js +23 -0
- package/esm/internals/getWordsByLines.d.ts +2 -1
- package/esm/internals/index.d.ts +5 -0
- package/esm/internals/index.js +5 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/index.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +25 -10
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.js +49 -12
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +5 -7
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +19 -4
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +23 -4
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +5 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -2
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +2 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +16 -12
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +7 -7
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +37 -22
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +15 -10
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +10 -7
- package/esm/internals/plugins/models/seriesConfig/index.d.ts +1 -0
- package/esm/internals/plugins/models/seriesConfig/index.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +5 -0
- package/esm/internals/plugins/models/seriesConfig/seriesLayout.types.d.ts +6 -0
- package/esm/internals/plugins/models/seriesConfig/seriesLayout.types.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +6 -4
- package/esm/internals/seriesSelectorOfType.d.ts +3 -3
- package/esm/internals/seriesSelectorOfType.js +1 -1
- package/esm/models/axis.d.ts +5 -0
- package/esm/models/seriesType/bar.d.ts +3 -2
- package/esm/models/seriesType/config.d.ts +10 -0
- package/esm/models/seriesType/index.d.ts +1 -0
- package/hooks/useInteractionItemProps.d.ts +0 -5
- package/hooks/useInteractionItemProps.js +1 -13
- package/hooks/useIsHydrated.js +1 -1
- package/hooks/useTicks.d.ts +15 -2
- package/hooks/useTicks.js +45 -6
- package/index.js +1 -1
- package/internals/domUtils.d.ts +6 -3
- package/internals/getBandSize.d.ts +13 -0
- package/internals/getBandSize.js +29 -0
- package/internals/getWordsByLines.d.ts +2 -1
- package/internals/index.d.ts +5 -0
- package/internals/index.js +48 -0
- package/internals/plugins/corePlugins/useChartSeries/index.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +25 -10
- package/internals/plugins/corePlugins/useChartSeries/processSeries.js +53 -14
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +4 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +19 -4
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +23 -4
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +5 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +1 -1
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +2 -4
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +16 -12
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +7 -7
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +35 -20
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +15 -10
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +10 -6
- package/internals/plugins/models/seriesConfig/index.d.ts +1 -0
- package/internals/plugins/models/seriesConfig/index.js +11 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +5 -0
- package/internals/plugins/models/seriesConfig/seriesLayout.types.d.ts +6 -0
- package/internals/plugins/models/seriesConfig/seriesLayout.types.js +5 -0
- package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +6 -4
- package/internals/seriesSelectorOfType.d.ts +3 -3
- package/internals/seriesSelectorOfType.js +1 -1
- package/models/axis.d.ts +5 -0
- package/models/seriesType/bar.d.ts +3 -2
- package/models/seriesType/config.d.ts +10 -0
- package/models/seriesType/index.d.ts +1 -0
- package/package.json +4 -4
- package/BarChart/checkScaleErrors.d.ts +0 -10
- package/esm/BarChart/checkScaleErrors.d.ts +0 -10
|
@@ -208,6 +208,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
208
208
|
tickNumber: PropTypes.number,
|
|
209
209
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
210
210
|
tickSize: PropTypes.number,
|
|
211
|
+
tickSpacing: PropTypes.number,
|
|
211
212
|
valueFormatter: PropTypes.func
|
|
212
213
|
})),
|
|
213
214
|
/**
|
|
@@ -269,6 +270,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
269
270
|
tickNumber: PropTypes.number,
|
|
270
271
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
271
272
|
tickSize: PropTypes.number,
|
|
273
|
+
tickSpacing: PropTypes.number,
|
|
272
274
|
valueFormatter: PropTypes.func
|
|
273
275
|
}), PropTypes.shape({
|
|
274
276
|
classes: PropTypes.object,
|
|
@@ -322,6 +324,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
322
324
|
tickNumber: PropTypes.number,
|
|
323
325
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
324
326
|
tickSize: PropTypes.number,
|
|
327
|
+
tickSpacing: PropTypes.number,
|
|
325
328
|
valueFormatter: PropTypes.func
|
|
326
329
|
}), PropTypes.shape({
|
|
327
330
|
classes: PropTypes.object,
|
|
@@ -367,6 +370,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
367
370
|
tickNumber: PropTypes.number,
|
|
368
371
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
369
372
|
tickSize: PropTypes.number,
|
|
373
|
+
tickSpacing: PropTypes.number,
|
|
370
374
|
valueFormatter: PropTypes.func
|
|
371
375
|
}), PropTypes.shape({
|
|
372
376
|
classes: PropTypes.object,
|
|
@@ -413,6 +417,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
413
417
|
tickNumber: PropTypes.number,
|
|
414
418
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
415
419
|
tickSize: PropTypes.number,
|
|
420
|
+
tickSpacing: PropTypes.number,
|
|
416
421
|
valueFormatter: PropTypes.func
|
|
417
422
|
}), PropTypes.shape({
|
|
418
423
|
classes: PropTypes.object,
|
|
@@ -458,6 +463,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
458
463
|
tickNumber: PropTypes.number,
|
|
459
464
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
460
465
|
tickSize: PropTypes.number,
|
|
466
|
+
tickSpacing: PropTypes.number,
|
|
461
467
|
valueFormatter: PropTypes.func
|
|
462
468
|
}), PropTypes.shape({
|
|
463
469
|
classes: PropTypes.object,
|
|
@@ -503,6 +509,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
503
509
|
tickNumber: PropTypes.number,
|
|
504
510
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
505
511
|
tickSize: PropTypes.number,
|
|
512
|
+
tickSpacing: PropTypes.number,
|
|
506
513
|
valueFormatter: PropTypes.func
|
|
507
514
|
}), PropTypes.shape({
|
|
508
515
|
classes: PropTypes.object,
|
|
@@ -552,6 +559,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
552
559
|
tickNumber: PropTypes.number,
|
|
553
560
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
554
561
|
tickSize: PropTypes.number,
|
|
562
|
+
tickSpacing: PropTypes.number,
|
|
555
563
|
valueFormatter: PropTypes.func
|
|
556
564
|
}), PropTypes.shape({
|
|
557
565
|
classes: PropTypes.object,
|
|
@@ -601,6 +609,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
601
609
|
tickNumber: PropTypes.number,
|
|
602
610
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
603
611
|
tickSize: PropTypes.number,
|
|
612
|
+
tickSpacing: PropTypes.number,
|
|
604
613
|
valueFormatter: PropTypes.func
|
|
605
614
|
}), PropTypes.shape({
|
|
606
615
|
classes: PropTypes.object,
|
|
@@ -646,6 +655,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
646
655
|
tickNumber: PropTypes.number,
|
|
647
656
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
648
657
|
tickSize: PropTypes.number,
|
|
658
|
+
tickSpacing: PropTypes.number,
|
|
649
659
|
valueFormatter: PropTypes.func
|
|
650
660
|
})]).isRequired),
|
|
651
661
|
/**
|
|
@@ -738,6 +748,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
738
748
|
tickNumber: PropTypes.number,
|
|
739
749
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
740
750
|
tickSize: PropTypes.number,
|
|
751
|
+
tickSpacing: PropTypes.number,
|
|
741
752
|
valueFormatter: PropTypes.func
|
|
742
753
|
}), PropTypes.shape({
|
|
743
754
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -790,6 +801,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
790
801
|
tickNumber: PropTypes.number,
|
|
791
802
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
792
803
|
tickSize: PropTypes.number,
|
|
804
|
+
tickSpacing: PropTypes.number,
|
|
793
805
|
valueFormatter: PropTypes.func
|
|
794
806
|
}), PropTypes.shape({
|
|
795
807
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -834,6 +846,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
834
846
|
tickNumber: PropTypes.number,
|
|
835
847
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
836
848
|
tickSize: PropTypes.number,
|
|
849
|
+
tickSpacing: PropTypes.number,
|
|
837
850
|
valueFormatter: PropTypes.func
|
|
838
851
|
}), PropTypes.shape({
|
|
839
852
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -879,6 +892,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
879
892
|
tickNumber: PropTypes.number,
|
|
880
893
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
881
894
|
tickSize: PropTypes.number,
|
|
895
|
+
tickSpacing: PropTypes.number,
|
|
882
896
|
valueFormatter: PropTypes.func
|
|
883
897
|
}), PropTypes.shape({
|
|
884
898
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -923,6 +937,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
923
937
|
tickNumber: PropTypes.number,
|
|
924
938
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
925
939
|
tickSize: PropTypes.number,
|
|
940
|
+
tickSpacing: PropTypes.number,
|
|
926
941
|
valueFormatter: PropTypes.func
|
|
927
942
|
}), PropTypes.shape({
|
|
928
943
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -967,6 +982,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
967
982
|
tickNumber: PropTypes.number,
|
|
968
983
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
969
984
|
tickSize: PropTypes.number,
|
|
985
|
+
tickSpacing: PropTypes.number,
|
|
970
986
|
valueFormatter: PropTypes.func
|
|
971
987
|
}), PropTypes.shape({
|
|
972
988
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -1015,6 +1031,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1015
1031
|
tickNumber: PropTypes.number,
|
|
1016
1032
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1017
1033
|
tickSize: PropTypes.number,
|
|
1034
|
+
tickSpacing: PropTypes.number,
|
|
1018
1035
|
valueFormatter: PropTypes.func
|
|
1019
1036
|
}), PropTypes.shape({
|
|
1020
1037
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -1063,6 +1080,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1063
1080
|
tickNumber: PropTypes.number,
|
|
1064
1081
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1065
1082
|
tickSize: PropTypes.number,
|
|
1083
|
+
tickSpacing: PropTypes.number,
|
|
1066
1084
|
valueFormatter: PropTypes.func
|
|
1067
1085
|
}), PropTypes.shape({
|
|
1068
1086
|
axis: PropTypes.oneOf(['x']),
|
|
@@ -1107,6 +1125,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1107
1125
|
tickNumber: PropTypes.number,
|
|
1108
1126
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1109
1127
|
tickSize: PropTypes.number,
|
|
1128
|
+
tickSpacing: PropTypes.number,
|
|
1110
1129
|
valueFormatter: PropTypes.func
|
|
1111
1130
|
})]).isRequired),
|
|
1112
1131
|
/**
|
|
@@ -1165,6 +1184,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1165
1184
|
tickNumber: PropTypes.number,
|
|
1166
1185
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1167
1186
|
tickSize: PropTypes.number,
|
|
1187
|
+
tickSpacing: PropTypes.number,
|
|
1168
1188
|
valueFormatter: PropTypes.func,
|
|
1169
1189
|
width: PropTypes.number
|
|
1170
1190
|
}), PropTypes.shape({
|
|
@@ -1216,6 +1236,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1216
1236
|
tickNumber: PropTypes.number,
|
|
1217
1237
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1218
1238
|
tickSize: PropTypes.number,
|
|
1239
|
+
tickSpacing: PropTypes.number,
|
|
1219
1240
|
valueFormatter: PropTypes.func,
|
|
1220
1241
|
width: PropTypes.number
|
|
1221
1242
|
}), PropTypes.shape({
|
|
@@ -1259,6 +1280,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1259
1280
|
tickNumber: PropTypes.number,
|
|
1260
1281
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1261
1282
|
tickSize: PropTypes.number,
|
|
1283
|
+
tickSpacing: PropTypes.number,
|
|
1262
1284
|
valueFormatter: PropTypes.func,
|
|
1263
1285
|
width: PropTypes.number
|
|
1264
1286
|
}), PropTypes.shape({
|
|
@@ -1303,6 +1325,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1303
1325
|
tickNumber: PropTypes.number,
|
|
1304
1326
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1305
1327
|
tickSize: PropTypes.number,
|
|
1328
|
+
tickSpacing: PropTypes.number,
|
|
1306
1329
|
valueFormatter: PropTypes.func,
|
|
1307
1330
|
width: PropTypes.number
|
|
1308
1331
|
}), PropTypes.shape({
|
|
@@ -1346,6 +1369,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1346
1369
|
tickNumber: PropTypes.number,
|
|
1347
1370
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1348
1371
|
tickSize: PropTypes.number,
|
|
1372
|
+
tickSpacing: PropTypes.number,
|
|
1349
1373
|
valueFormatter: PropTypes.func,
|
|
1350
1374
|
width: PropTypes.number
|
|
1351
1375
|
}), PropTypes.shape({
|
|
@@ -1389,6 +1413,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1389
1413
|
tickNumber: PropTypes.number,
|
|
1390
1414
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1391
1415
|
tickSize: PropTypes.number,
|
|
1416
|
+
tickSpacing: PropTypes.number,
|
|
1392
1417
|
valueFormatter: PropTypes.func,
|
|
1393
1418
|
width: PropTypes.number
|
|
1394
1419
|
}), PropTypes.shape({
|
|
@@ -1436,6 +1461,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1436
1461
|
tickNumber: PropTypes.number,
|
|
1437
1462
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1438
1463
|
tickSize: PropTypes.number,
|
|
1464
|
+
tickSpacing: PropTypes.number,
|
|
1439
1465
|
valueFormatter: PropTypes.func,
|
|
1440
1466
|
width: PropTypes.number
|
|
1441
1467
|
}), PropTypes.shape({
|
|
@@ -1483,6 +1509,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1483
1509
|
tickNumber: PropTypes.number,
|
|
1484
1510
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1485
1511
|
tickSize: PropTypes.number,
|
|
1512
|
+
tickSpacing: PropTypes.number,
|
|
1486
1513
|
valueFormatter: PropTypes.func,
|
|
1487
1514
|
width: PropTypes.number
|
|
1488
1515
|
}), PropTypes.shape({
|
|
@@ -1526,6 +1553,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
1526
1553
|
tickNumber: PropTypes.number,
|
|
1527
1554
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1528
1555
|
tickSize: PropTypes.number,
|
|
1556
|
+
tickSpacing: PropTypes.number,
|
|
1529
1557
|
valueFormatter: PropTypes.func,
|
|
1530
1558
|
width: PropTypes.number
|
|
1531
1559
|
})]).isRequired),
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTicks } from "../hooks/useTicks.js";
|
|
3
3
|
import { GridLine } from "./styledComponents.js";
|
|
4
|
+
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
/**
|
|
6
7
|
* @ignore - internal component.
|
|
7
8
|
*/
|
|
8
9
|
export function ChartsGridHorizontal(props) {
|
|
10
|
+
const {
|
|
11
|
+
instance
|
|
12
|
+
} = useChartContext();
|
|
9
13
|
const {
|
|
10
14
|
axis,
|
|
11
15
|
start,
|
|
@@ -15,19 +19,21 @@ export function ChartsGridHorizontal(props) {
|
|
|
15
19
|
const {
|
|
16
20
|
scale,
|
|
17
21
|
tickNumber,
|
|
18
|
-
tickInterval
|
|
22
|
+
tickInterval,
|
|
23
|
+
tickSpacing
|
|
19
24
|
} = axis;
|
|
20
25
|
const yTicks = useTicks({
|
|
21
26
|
scale,
|
|
22
27
|
tickNumber,
|
|
23
28
|
tickInterval,
|
|
29
|
+
tickSpacing,
|
|
24
30
|
direction: 'y'
|
|
25
31
|
});
|
|
26
32
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
27
33
|
children: yTicks.map(({
|
|
28
34
|
value,
|
|
29
35
|
offset
|
|
30
|
-
}) => /*#__PURE__*/_jsx(GridLine, {
|
|
36
|
+
}) => !instance.isYInside(offset) ? null : /*#__PURE__*/_jsx(GridLine, {
|
|
31
37
|
y1: offset,
|
|
32
38
|
y2: offset,
|
|
33
39
|
x1: start,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTicks } from "../hooks/useTicks.js";
|
|
3
3
|
import { GridLine } from "./styledComponents.js";
|
|
4
|
+
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
/**
|
|
6
7
|
* @ignore - internal component.
|
|
7
8
|
*/
|
|
8
9
|
export function ChartsGridVertical(props) {
|
|
10
|
+
const {
|
|
11
|
+
instance
|
|
12
|
+
} = useChartContext();
|
|
9
13
|
const {
|
|
10
14
|
axis,
|
|
11
15
|
start,
|
|
@@ -15,19 +19,21 @@ export function ChartsGridVertical(props) {
|
|
|
15
19
|
const {
|
|
16
20
|
scale,
|
|
17
21
|
tickNumber,
|
|
18
|
-
tickInterval
|
|
22
|
+
tickInterval,
|
|
23
|
+
tickSpacing
|
|
19
24
|
} = axis;
|
|
20
25
|
const xTicks = useTicks({
|
|
21
26
|
scale,
|
|
22
27
|
tickNumber,
|
|
23
28
|
tickInterval,
|
|
29
|
+
tickSpacing,
|
|
24
30
|
direction: 'x'
|
|
25
31
|
});
|
|
26
32
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
27
33
|
children: xTicks.map(({
|
|
28
34
|
value,
|
|
29
35
|
offset
|
|
30
|
-
}) => /*#__PURE__*/_jsx(GridLine, {
|
|
36
|
+
}) => !instance.isXInside(offset) ? null : /*#__PURE__*/_jsx(GridLine, {
|
|
31
37
|
y1: start,
|
|
32
38
|
y2: end,
|
|
33
39
|
x1: offset,
|
|
@@ -23,6 +23,7 @@ import { useSvgRef } from "../hooks/index.js";
|
|
|
23
23
|
import { selectorBrushShouldPreventTooltip } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
const selectorReturnFalse = () => false;
|
|
26
|
+
const selectorReturnNull = () => null;
|
|
26
27
|
function getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush) {
|
|
27
28
|
if (shouldPreventBecauseOfBrush) {
|
|
28
29
|
return selectorReturnFalse;
|
|
@@ -85,7 +86,7 @@ function ChartsTooltipContainer(inProps) {
|
|
|
85
86
|
const isOpen = useSelector(store, getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
|
|
86
87
|
const lastInteraction = useSelector(store, selectorChartsLastInteraction);
|
|
87
88
|
const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
|
|
88
|
-
const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition :
|
|
89
|
+
const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : selectorReturnNull, position);
|
|
89
90
|
React.useEffect(() => {
|
|
90
91
|
const svgElement = svgRef.current;
|
|
91
92
|
if (svgElement === null) {
|
|
@@ -43,6 +43,7 @@ function ChartsSingleXAxisTicks(inProps) {
|
|
|
43
43
|
tickPlacement,
|
|
44
44
|
tickLabelPlacement,
|
|
45
45
|
tickLabelMinGap,
|
|
46
|
+
tickSpacing,
|
|
46
47
|
height: axisHeight
|
|
47
48
|
} = defaultizedProps;
|
|
48
49
|
const drawingArea = useDrawingArea();
|
|
@@ -58,6 +59,7 @@ function ChartsSingleXAxisTicks(inProps) {
|
|
|
58
59
|
tickInterval,
|
|
59
60
|
tickPlacement,
|
|
60
61
|
tickLabelPlacement,
|
|
62
|
+
tickSpacing,
|
|
61
63
|
direction: 'x'
|
|
62
64
|
});
|
|
63
65
|
const visibleLabels = getVisibleLabels(xTicks, {
|
|
@@ -64,7 +64,9 @@ export function ChartsXAxisImpl(_ref) {
|
|
|
64
64
|
const Label = slots?.axisLabel ?? ChartsText;
|
|
65
65
|
const axisLabelProps = useSlotProps({
|
|
66
66
|
elementType: Label,
|
|
67
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
67
68
|
externalSlotProps: slotProps?.axisLabel,
|
|
69
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
68
70
|
additionalProps: {
|
|
69
71
|
style: _extends({}, theme.typography.body1, {
|
|
70
72
|
lineHeight: 1,
|