@mui/x-charts 9.0.3 → 9.1.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.mts +1 -2
- package/BarChart/BarChart.d.ts +1 -2
- package/BarChart/BarChart.js +2 -913
- package/BarChart/BarChart.mjs +2 -913
- package/BarChart/FocusedBar.js +3 -0
- package/BarChart/FocusedBar.mjs +3 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +2 -0
- package/CHANGELOG.md +220 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +94 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +88 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.js +86 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.mjs +80 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.js +26 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.mjs +16 -0
- package/ChartsAxisHighlightValue/index.d.mts +1 -0
- package/ChartsAxisHighlightValue/index.d.ts +1 -0
- package/ChartsAxisHighlightValue/index.js +16 -0
- package/ChartsAxisHighlightValue/index.mjs +1 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.mts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.ts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.js +130 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.mjs +124 -0
- package/ChartsContainer/ChartsContainer.js +4 -1431
- package/ChartsContainer/ChartsContainer.mjs +4 -1431
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +56 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +50 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.js +5 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.mjs +1 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.mts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.ts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.js +70 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.mjs +64 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +87 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +81 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.js +98 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.mjs +92 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.mts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.ts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.js +14 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.mjs +6 -0
- package/ChartsRadialAxisHighlight/index.d.mts +5 -0
- package/ChartsRadialAxisHighlight/index.d.ts +5 -0
- package/ChartsRadialAxisHighlight/index.js +47 -0
- package/ChartsRadialAxisHighlight/index.mjs +4 -0
- package/ChartsRadiusAxis/index.d.mts +3 -2
- package/ChartsRadiusAxis/index.d.ts +3 -2
- package/ChartsRadiusAxis/index.mjs +3 -1
- package/ChartsRotationAxis/index.d.mts +3 -2
- package/ChartsRotationAxis/index.d.ts +3 -2
- package/ChartsRotationAxis/index.mjs +3 -1
- package/ChartsTooltip/useAxesTooltip.js +11 -3
- package/ChartsTooltip/useAxesTooltip.mjs +11 -3
- package/ChartsXAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsXAxis/useAxisTicksProps.d.ts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.ts +162 -81
- package/LICENSE +2 -0
- package/LineChart/FocusedLineMark.js +3 -0
- package/LineChart/FocusedLineMark.mjs +3 -0
- package/LineChart/LineChart.js +2 -913
- package/LineChart/LineChart.mjs +2 -913
- package/LineChart/seriesConfig/curveEvaluation.d.mts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.d.ts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.js +132 -0
- package/LineChart/seriesConfig/curveEvaluation.mjs +131 -0
- package/LineChart/seriesConfig/getItemAtPosition.js +12 -35
- package/LineChart/seriesConfig/getItemAtPosition.mjs +10 -33
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +2 -1
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +2 -1
- package/LineChart/seriesConfig/seriesProcessor.js +4 -0
- package/LineChart/seriesConfig/seriesProcessor.mjs +4 -0
- package/LineChart/useAreaPlotData.js +4 -0
- package/LineChart/useAreaPlotData.mjs +4 -0
- package/LineChart/useLinePlotData.js +2 -0
- package/LineChart/useLinePlotData.mjs +2 -0
- package/LineChart/useMarkPlotData.js +2 -0
- package/LineChart/useMarkPlotData.mjs +2 -0
- package/PieChart/FocusedPieArc.js +3 -0
- package/PieChart/FocusedPieArc.mjs +3 -0
- package/RadarChart/FocusedRadarMark.js +3 -0
- package/RadarChart/FocusedRadarMark.mjs +3 -0
- package/ScatterChart/FocusedScatterMark.js +10 -21
- package/ScatterChart/FocusedScatterMark.mjs +10 -21
- package/ScatterChart/HighlightedScatterMark.d.mts +11 -0
- package/ScatterChart/HighlightedScatterMark.d.ts +11 -0
- package/ScatterChart/HighlightedScatterMark.js +68 -0
- package/ScatterChart/HighlightedScatterMark.mjs +62 -0
- package/ScatterChart/ScatterChart.d.mts +1 -2
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +2 -913
- package/ScatterChart/ScatterChart.mjs +2 -913
- package/ScatterChart/index.d.mts +1 -0
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/index.mjs +1 -0
- package/ScatterChart/scatterClasses.d.mts +3 -1
- package/ScatterChart/scatterClasses.d.ts +3 -1
- package/ScatterChart/scatterClasses.js +3 -2
- package/ScatterChart/scatterClasses.mjs +3 -2
- package/ScatterChart/useScatterChartProps.js +3 -1
- package/ScatterChart/useScatterChartProps.mjs +3 -1
- package/ScatterChart/useScatterItemPosition.d.mts +16 -0
- package/ScatterChart/useScatterItemPosition.d.ts +16 -0
- package/ScatterChart/useScatterItemPosition.js +47 -0
- package/ScatterChart/useScatterItemPosition.mjs +41 -0
- package/SparkLineChart/SparkLineChart.js +2 -913
- package/SparkLineChart/SparkLineChart.mjs +2 -913
- package/hooks/useAxis.d.mts +3 -3
- package/hooks/useAxis.d.ts +3 -3
- package/hooks/useAxisSystem.d.mts +1 -1
- package/hooks/useAxisSystem.d.ts +1 -1
- package/hooks/useAxisSystem.js +1 -1
- package/hooks/useAxisSystem.mjs +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +25 -1
- package/index.mjs +3 -1
- package/internals/commonNextFocusItem.js +62 -8
- package/internals/commonNextFocusItem.mjs +62 -8
- package/internals/findClosestIndex.d.mts +5 -0
- package/internals/findClosestIndex.d.ts +5 -0
- package/internals/findClosestIndex.js +27 -0
- package/internals/findClosestIndex.mjs +22 -0
- package/internals/getAsNumber.d.mts +1 -0
- package/internals/getAsNumber.d.ts +1 -0
- package/internals/getAsNumber.js +9 -0
- package/internals/getAsNumber.mjs +3 -0
- package/internals/index.d.mts +6 -0
- package/internals/index.d.ts +6 -0
- package/internals/index.js +60 -0
- package/internals/index.mjs +6 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +4 -21
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs +4 -21
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js +57 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs +51 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +27 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +27 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +1 -1
- package/models/axis.d.mts +28 -28
- package/models/axis.d.ts +28 -28
- package/models/axis.js +5 -1
- package/models/axis.mjs +5 -1
- package/models/seriesType/line.d.mts +6 -6
- package/models/seriesType/line.d.ts +6 -6
- package/package.json +170 -142
package/internals/index.js
CHANGED
|
@@ -20,15 +20,24 @@ var _exportNames = {
|
|
|
20
20
|
useRegisterPointerInteractions: true,
|
|
21
21
|
getCartesianAxisTriggerTooltip: true,
|
|
22
22
|
getCartesianAxisIndex: true,
|
|
23
|
+
getPolarAxisIndex: true,
|
|
23
24
|
createCommonKeyboardFocusHandler: true,
|
|
24
25
|
getSeriesColorFn: true,
|
|
25
26
|
checkBarChartScaleErrors: true,
|
|
26
27
|
getBandSize: true,
|
|
28
|
+
EPSILON: true,
|
|
27
29
|
useChartsTooltipUtilityClasses: true,
|
|
28
30
|
getChartsTooltipUtilityClass: true,
|
|
29
31
|
getAxisExtrema: true,
|
|
32
|
+
evaluateCurveAtAngle: true,
|
|
30
33
|
getLineItemAtPosition: true
|
|
31
34
|
};
|
|
35
|
+
Object.defineProperty(exports, "EPSILON", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return _epsilon.EPSILON;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
32
41
|
Object.defineProperty(exports, "checkBarChartScaleErrors", {
|
|
33
42
|
enumerable: true,
|
|
34
43
|
get: function () {
|
|
@@ -41,6 +50,12 @@ Object.defineProperty(exports, "createCommonKeyboardFocusHandler", {
|
|
|
41
50
|
return _createCommonKeyboardFocusHandler.createCommonKeyboardFocusHandler;
|
|
42
51
|
}
|
|
43
52
|
});
|
|
53
|
+
Object.defineProperty(exports, "evaluateCurveAtAngle", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () {
|
|
56
|
+
return _curveEvaluation.evaluateCurveAtAngle;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
44
59
|
Object.defineProperty(exports, "getAxisExtrema", {
|
|
45
60
|
enumerable: true,
|
|
46
61
|
get: function () {
|
|
@@ -77,6 +92,12 @@ Object.defineProperty(exports, "getLineItemAtPosition", {
|
|
|
77
92
|
return _getItemAtPosition.default;
|
|
78
93
|
}
|
|
79
94
|
});
|
|
95
|
+
Object.defineProperty(exports, "getPolarAxisIndex", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function () {
|
|
98
|
+
return _getAxisIndex.getAxisIndex;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
80
101
|
Object.defineProperty(exports, "getSeriesColorFn", {
|
|
81
102
|
enumerable: true,
|
|
82
103
|
get: function () {
|
|
@@ -506,6 +527,7 @@ Object.keys(_selectors).forEach(function (key) {
|
|
|
506
527
|
});
|
|
507
528
|
var _getAxisTriggerTooltip = require("./plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip");
|
|
508
529
|
var _getAxisValue = require("./plugins/featurePlugins/useChartCartesianAxis/getAxisValue");
|
|
530
|
+
var _getAxisIndex = require("./plugins/featurePlugins/useChartPolarAxis/getAxisIndex");
|
|
509
531
|
var _useCharts = require("./store/useCharts");
|
|
510
532
|
Object.keys(_useCharts).forEach(function (key) {
|
|
511
533
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -602,6 +624,18 @@ Object.keys(_configInit).forEach(function (key) {
|
|
|
602
624
|
}
|
|
603
625
|
});
|
|
604
626
|
});
|
|
627
|
+
var _clampAngle = require("./clampAngle");
|
|
628
|
+
Object.keys(_clampAngle).forEach(function (key) {
|
|
629
|
+
if (key === "default" || key === "__esModule") return;
|
|
630
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
631
|
+
if (key in exports && exports[key] === _clampAngle[key]) return;
|
|
632
|
+
Object.defineProperty(exports, key, {
|
|
633
|
+
enumerable: true,
|
|
634
|
+
get: function () {
|
|
635
|
+
return _clampAngle[key];
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
});
|
|
605
639
|
var _getLabel = require("./getLabel");
|
|
606
640
|
Object.keys(_getLabel).forEach(function (key) {
|
|
607
641
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -662,6 +696,18 @@ Object.keys(_getScale).forEach(function (key) {
|
|
|
662
696
|
}
|
|
663
697
|
});
|
|
664
698
|
});
|
|
699
|
+
var _getAsNumber = require("./getAsNumber");
|
|
700
|
+
Object.keys(_getAsNumber).forEach(function (key) {
|
|
701
|
+
if (key === "default" || key === "__esModule") return;
|
|
702
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
703
|
+
if (key in exports && exports[key] === _getAsNumber[key]) return;
|
|
704
|
+
Object.defineProperty(exports, key, {
|
|
705
|
+
enumerable: true,
|
|
706
|
+
get: function () {
|
|
707
|
+
return _getAsNumber[key];
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
});
|
|
665
711
|
var _stacking = require("./stacking");
|
|
666
712
|
Object.keys(_stacking).forEach(function (key) {
|
|
667
713
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -686,6 +732,18 @@ Object.keys(_getCurve).forEach(function (key) {
|
|
|
686
732
|
}
|
|
687
733
|
});
|
|
688
734
|
});
|
|
735
|
+
var _getSymbol = require("./getSymbol");
|
|
736
|
+
Object.keys(_getSymbol).forEach(function (key) {
|
|
737
|
+
if (key === "default" || key === "__esModule") return;
|
|
738
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
739
|
+
if (key in exports && exports[key] === _getSymbol[key]) return;
|
|
740
|
+
Object.defineProperty(exports, key, {
|
|
741
|
+
enumerable: true,
|
|
742
|
+
get: function () {
|
|
743
|
+
return _getSymbol[key];
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
});
|
|
689
747
|
var _consumeSlots = require("./consumeSlots");
|
|
690
748
|
Object.keys(_consumeSlots).forEach(function (key) {
|
|
691
749
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -822,6 +880,7 @@ Object.keys(_defaultSeriesConfig).forEach(function (key) {
|
|
|
822
880
|
}
|
|
823
881
|
});
|
|
824
882
|
});
|
|
883
|
+
var _epsilon = require("../utils/epsilon");
|
|
825
884
|
var _chartsTooltipClasses = require("../ChartsTooltip/chartsTooltipClasses");
|
|
826
885
|
var _getAxisExtrema = require("./plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema");
|
|
827
886
|
var _ChartsProvider = require("../context/ChartsProvider");
|
|
@@ -1016,4 +1075,5 @@ Object.keys(_identifierCleaner).forEach(function (key) {
|
|
|
1016
1075
|
}
|
|
1017
1076
|
});
|
|
1018
1077
|
});
|
|
1078
|
+
var _curveEvaluation = require("../LineChart/seriesConfig/curveEvaluation");
|
|
1019
1079
|
var _getItemAtPosition = _interopRequireDefault(require("../LineChart/seriesConfig/getItemAtPosition"));
|
package/internals/index.mjs
CHANGED
|
@@ -45,6 +45,7 @@ export * from "./plugins/featurePlugins/useChartItemClick/index.mjs";
|
|
|
45
45
|
export * from "./plugins/utils/selectors.mjs";
|
|
46
46
|
export { getAxisTriggerTooltip as getCartesianAxisTriggerTooltip } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.mjs";
|
|
47
47
|
export { getAxisIndex as getCartesianAxisIndex } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs";
|
|
48
|
+
export { getAxisIndex as getPolarAxisIndex } from "./plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs";
|
|
48
49
|
export * from "./store/useCharts.mjs";
|
|
49
50
|
export * from "./store/useStore.mjs";
|
|
50
51
|
|
|
@@ -57,13 +58,16 @@ export * from "../PieChart/PieChart.plugins.mjs";
|
|
|
57
58
|
|
|
58
59
|
// utils
|
|
59
60
|
export * from "./configInit.mjs";
|
|
61
|
+
export * from "./clampAngle.mjs";
|
|
60
62
|
export * from "./getLabel.mjs";
|
|
61
63
|
export * from "./legendUtils.mjs";
|
|
62
64
|
export * from "./getChartPoint.mjs";
|
|
63
65
|
export * from "./isDefined.mjs";
|
|
64
66
|
export * from "./getScale.mjs";
|
|
67
|
+
export * from "./getAsNumber.mjs";
|
|
65
68
|
export * from "./stacking/index.mjs";
|
|
66
69
|
export * from "./getCurve.mjs";
|
|
70
|
+
export * from "./getSymbol.mjs";
|
|
67
71
|
export * from "./consumeSlots.mjs";
|
|
68
72
|
export * from "./consumeThemeProps.mjs";
|
|
69
73
|
export * from "./defaultizeMargin.mjs";
|
|
@@ -79,6 +83,7 @@ export { getSeriesColorFn } from "./getSeriesColorFn.mjs";
|
|
|
79
83
|
export { checkBarChartScaleErrors } from "../BarChart/checkBarChartScaleErrors.mjs";
|
|
80
84
|
export { getBandSize } from "./getBandSize.mjs";
|
|
81
85
|
export * from "./plugins/utils/defaultSeriesConfig.mjs";
|
|
86
|
+
export { EPSILON } from "../utils/epsilon.mjs";
|
|
82
87
|
export { useUtilityClasses as useChartsTooltipUtilityClasses, getChartsTooltipUtilityClass } from "../ChartsTooltip/chartsTooltipClasses.mjs";
|
|
83
88
|
|
|
84
89
|
// contexts
|
|
@@ -101,4 +106,5 @@ export * from "./constants.mjs";
|
|
|
101
106
|
export * from "./scales/index.mjs";
|
|
102
107
|
export * from "./identifierSerializer.mjs";
|
|
103
108
|
export * from "./identifierCleaner.mjs";
|
|
109
|
+
export { evaluateCurveAtAngle } from "../LineChart/seriesConfig/curveEvaluation.mjs";
|
|
104
110
|
export { default as getLineItemAtPosition } from "../LineChart/seriesConfig/getItemAtPosition.mjs";
|
package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js
CHANGED
|
@@ -52,10 +52,12 @@ const useChartInteractionListener = ({
|
|
|
52
52
|
}), new _core.TurnWheelGesture({
|
|
53
53
|
name: 'zoomTurnWheel',
|
|
54
54
|
sensitivity: 0.01,
|
|
55
|
-
initialDelta: 1
|
|
55
|
+
initialDelta: 1,
|
|
56
|
+
passive: false
|
|
56
57
|
}), new _core.TurnWheelGesture({
|
|
57
58
|
name: 'panTurnWheel',
|
|
58
|
-
sensitivity: 0.5
|
|
59
|
+
sensitivity: 0.5,
|
|
60
|
+
passive: false
|
|
59
61
|
}), new _core.TapAndDragGesture({
|
|
60
62
|
name: 'zoomTapAndDrag',
|
|
61
63
|
dragThreshold: 10
|
package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs
CHANGED
|
@@ -46,10 +46,12 @@ export const useChartInteractionListener = ({
|
|
|
46
46
|
}), new TurnWheelGesture({
|
|
47
47
|
name: 'zoomTurnWheel',
|
|
48
48
|
sensitivity: 0.01,
|
|
49
|
-
initialDelta: 1
|
|
49
|
+
initialDelta: 1,
|
|
50
|
+
passive: false
|
|
50
51
|
}), new TurnWheelGesture({
|
|
51
52
|
name: 'panTurnWheel',
|
|
52
|
-
sensitivity: 0.5
|
|
53
|
+
sensitivity: 0.5,
|
|
54
|
+
passive: false
|
|
53
55
|
}), new TapAndDragGesture({
|
|
54
56
|
name: 'zoomTapAndDrag',
|
|
55
57
|
dragThreshold: 10
|
package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PolarChartSeriesType, ChartSeriesDefaultized } from "../../../../../models/seriesType/config.mjs";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PolarAxisConfig } from "../../../../../models/axis.mjs";
|
|
3
3
|
import type { SeriesId } from "../../../../../models/seriesType/common.mjs";
|
|
4
4
|
type PolarExtremumGetterParams<SeriesType extends PolarChartSeriesType> = {
|
|
5
5
|
series: Record<SeriesId, ChartSeriesDefaultized<SeriesType>>;
|
|
6
|
-
axis:
|
|
6
|
+
axis: PolarAxisConfig;
|
|
7
7
|
axisIndex: number;
|
|
8
8
|
isDefaultAxis: boolean;
|
|
9
9
|
};
|
package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PolarChartSeriesType, ChartSeriesDefaultized } from "../../../../../models/seriesType/config.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PolarAxisConfig } from "../../../../../models/axis.js";
|
|
3
3
|
import type { SeriesId } from "../../../../../models/seriesType/common.js";
|
|
4
4
|
type PolarExtremumGetterParams<SeriesType extends PolarChartSeriesType> = {
|
|
5
5
|
series: Record<SeriesId, ChartSeriesDefaultized<SeriesType>>;
|
|
6
|
-
axis:
|
|
6
|
+
axis: PolarAxisConfig;
|
|
7
7
|
axisIndex: number;
|
|
8
8
|
isDefaultAxis: boolean;
|
|
9
9
|
};
|
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getAxisIndex = getAxisIndex;
|
|
7
7
|
exports.getAxisValue = getAxisValue;
|
|
8
8
|
var _scaleGuards = require("../../../scaleGuards");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
9
|
+
var _getAsNumber = require("../../../getAsNumber");
|
|
10
|
+
var _findClosestIndex = require("../../../findClosestIndex");
|
|
13
11
|
/**
|
|
14
12
|
* For a pointer coordinate, this function returns the dataIndex associated.
|
|
15
13
|
* Returns `-1` if no dataIndex matches.
|
|
@@ -21,26 +19,11 @@ function getAxisIndex(axisConfig, pointerValue) {
|
|
|
21
19
|
reverse
|
|
22
20
|
} = axisConfig;
|
|
23
21
|
if (!(0, _scaleGuards.isOrdinalScale)(scale)) {
|
|
24
|
-
const value = scale.invert(pointerValue);
|
|
25
22
|
if (axisData === undefined) {
|
|
26
23
|
return -1;
|
|
27
24
|
}
|
|
28
|
-
const valueAsNumber =
|
|
29
|
-
|
|
30
|
-
const v = getAsANumber(pointValue);
|
|
31
|
-
if (v > valueAsNumber) {
|
|
32
|
-
if (index === 0 || Math.abs(valueAsNumber - v) <= Math.abs(valueAsNumber - getAsANumber(axisData[index - 1]))) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (v <= valueAsNumber) {
|
|
37
|
-
if (index === axisData.length - 1 || Math.abs(getAsANumber(value) - v) < Math.abs(getAsANumber(value) - getAsANumber(axisData[index + 1]))) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
});
|
|
43
|
-
return closestIndex;
|
|
25
|
+
const valueAsNumber = (0, _getAsNumber.getAsNumber)(scale.invert(pointerValue));
|
|
26
|
+
return (0, _findClosestIndex.findClosestIndex)(axisData, valueAsNumber);
|
|
44
27
|
}
|
|
45
28
|
const dataIndex = scale.bandwidth() === 0 ? Math.floor((pointerValue - Math.min(...scale.range()) + scale.step() / 2) / scale.step()) : Math.floor((pointerValue - Math.min(...scale.range())) / scale.step());
|
|
46
29
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { isOrdinalScale } from "../../../scaleGuards.mjs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
2
|
+
import { getAsNumber } from "../../../getAsNumber.mjs";
|
|
3
|
+
import { findClosestIndex } from "../../../findClosestIndex.mjs";
|
|
6
4
|
/**
|
|
7
5
|
* For a pointer coordinate, this function returns the dataIndex associated.
|
|
8
6
|
* Returns `-1` if no dataIndex matches.
|
|
@@ -14,26 +12,11 @@ export function getAxisIndex(axisConfig, pointerValue) {
|
|
|
14
12
|
reverse
|
|
15
13
|
} = axisConfig;
|
|
16
14
|
if (!isOrdinalScale(scale)) {
|
|
17
|
-
const value = scale.invert(pointerValue);
|
|
18
15
|
if (axisData === undefined) {
|
|
19
16
|
return -1;
|
|
20
17
|
}
|
|
21
|
-
const valueAsNumber =
|
|
22
|
-
|
|
23
|
-
const v = getAsANumber(pointValue);
|
|
24
|
-
if (v > valueAsNumber) {
|
|
25
|
-
if (index === 0 || Math.abs(valueAsNumber - v) <= Math.abs(valueAsNumber - getAsANumber(axisData[index - 1]))) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (v <= valueAsNumber) {
|
|
30
|
-
if (index === axisData.length - 1 || Math.abs(getAsANumber(value) - v) < Math.abs(getAsANumber(value) - getAsANumber(axisData[index + 1]))) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
});
|
|
36
|
-
return closestIndex;
|
|
18
|
+
const valueAsNumber = getAsNumber(scale.invert(pointerValue));
|
|
19
|
+
return findClosestIndex(axisData, valueAsNumber);
|
|
37
20
|
}
|
|
38
21
|
const dataIndex = scale.bandwidth() === 0 ? Math.floor((pointerValue - Math.min(...scale.range()) + scale.step() / 2) / scale.step()) : Math.floor((pointerValue - Math.min(...scale.range())) / scale.step());
|
|
39
22
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
@@ -138,8 +138,9 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
138
138
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
139
139
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
140
140
|
}, "scale">> & {
|
|
141
|
-
position?: "left" | "right" |
|
|
142
|
-
|
|
141
|
+
position?: "none" | "left" | "right" | undefined;
|
|
142
|
+
height?: undefined;
|
|
143
|
+
width?: number | "auto" | undefined;
|
|
143
144
|
} & import("../../../../hooks/useTicks.mjs").TickParams & import("../../../index.mjs").AxisConfigExtension & {
|
|
144
145
|
zoom: import("./useChartCartesianAxis.types.mjs").DefaultizedZoomOptions | undefined;
|
|
145
146
|
}) | undefined;
|
|
@@ -138,8 +138,9 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
138
138
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
139
139
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
140
140
|
}, "scale">> & {
|
|
141
|
-
position?: "left" | "right" |
|
|
142
|
-
|
|
141
|
+
position?: "none" | "left" | "right" | undefined;
|
|
142
|
+
height?: undefined;
|
|
143
|
+
width?: number | "auto" | undefined;
|
|
143
144
|
} & import("../../../../hooks/useTicks.js").TickParams & import("../../../index.js").AxisConfigExtension & {
|
|
144
145
|
zoom: import("./useChartCartesianAxis.types.js").DefaultizedZoomOptions | undefined;
|
|
145
146
|
}) | undefined;
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SeriesId } from "../../../../../models/seriesType/common.mjs";
|
|
2
|
+
import type { ChartSeriesType } from "../../../../../models/seriesType/config.mjs";
|
|
3
|
+
import type { ProcessedSeries } from "../../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
6
|
+
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
7
|
+
*
|
|
8
|
+
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
9
|
+
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
10
|
+
* `hidden` flag on individual data items; for other series types the data
|
|
11
|
+
* elements are scalars or objects without that field, and this helper returns
|
|
12
|
+
* the proposed index unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findVisibleDataIndex({
|
|
15
|
+
processedSeries,
|
|
16
|
+
type,
|
|
17
|
+
seriesId,
|
|
18
|
+
startIndex,
|
|
19
|
+
dataLength,
|
|
20
|
+
direction,
|
|
21
|
+
allowCycles
|
|
22
|
+
}: {
|
|
23
|
+
processedSeries: ProcessedSeries<ChartSeriesType>;
|
|
24
|
+
type: ChartSeriesType;
|
|
25
|
+
seriesId: SeriesId;
|
|
26
|
+
startIndex: number;
|
|
27
|
+
dataLength: number;
|
|
28
|
+
direction: 1 | -1;
|
|
29
|
+
allowCycles: boolean;
|
|
30
|
+
}): number | null;
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SeriesId } from "../../../../../models/seriesType/common.js";
|
|
2
|
+
import type { ChartSeriesType } from "../../../../../models/seriesType/config.js";
|
|
3
|
+
import type { ProcessedSeries } from "../../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
6
|
+
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
7
|
+
*
|
|
8
|
+
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
9
|
+
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
10
|
+
* `hidden` flag on individual data items; for other series types the data
|
|
11
|
+
* elements are scalars or objects without that field, and this helper returns
|
|
12
|
+
* the proposed index unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findVisibleDataIndex({
|
|
15
|
+
processedSeries,
|
|
16
|
+
type,
|
|
17
|
+
seriesId,
|
|
18
|
+
startIndex,
|
|
19
|
+
dataLength,
|
|
20
|
+
direction,
|
|
21
|
+
allowCycles
|
|
22
|
+
}: {
|
|
23
|
+
processedSeries: ProcessedSeries<ChartSeriesType>;
|
|
24
|
+
type: ChartSeriesType;
|
|
25
|
+
seriesId: SeriesId;
|
|
26
|
+
startIndex: number;
|
|
27
|
+
dataLength: number;
|
|
28
|
+
direction: 1 | -1;
|
|
29
|
+
allowCycles: boolean;
|
|
30
|
+
}): number | null;
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findVisibleDataIndex = findVisibleDataIndex;
|
|
7
|
+
/**
|
|
8
|
+
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
9
|
+
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
10
|
+
*
|
|
11
|
+
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
12
|
+
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
13
|
+
* `hidden` flag on individual data items; for other series types the data
|
|
14
|
+
* elements are scalars or objects without that field, and this helper returns
|
|
15
|
+
* the proposed index unchanged.
|
|
16
|
+
*/
|
|
17
|
+
function findVisibleDataIndex({
|
|
18
|
+
processedSeries,
|
|
19
|
+
type,
|
|
20
|
+
seriesId,
|
|
21
|
+
startIndex,
|
|
22
|
+
dataLength,
|
|
23
|
+
direction,
|
|
24
|
+
allowCycles
|
|
25
|
+
}) {
|
|
26
|
+
if (dataLength <= 0) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
30
|
+
if (seriesItem && 'hidden' in seriesItem && seriesItem.hidden) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const seriesData = seriesItem?.data;
|
|
34
|
+
const isIndexHidden = idx => {
|
|
35
|
+
if (!seriesData) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const item = seriesData[idx];
|
|
39
|
+
return typeof item === 'object' && item !== null && 'hidden' in item && Boolean(item.hidden);
|
|
40
|
+
};
|
|
41
|
+
let dataIndex = startIndex;
|
|
42
|
+
for (let attempt = 0; attempt < dataLength; attempt += 1) {
|
|
43
|
+
if (dataIndex >= 0 && dataIndex < dataLength && !isIndexHidden(dataIndex)) {
|
|
44
|
+
return dataIndex;
|
|
45
|
+
}
|
|
46
|
+
if (allowCycles) {
|
|
47
|
+
dataIndex = (dataIndex + direction + dataLength) % dataLength;
|
|
48
|
+
} else {
|
|
49
|
+
const next = dataIndex + direction;
|
|
50
|
+
if (next < 0 || next >= dataLength) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
dataIndex = next;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
3
|
+
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
4
|
+
*
|
|
5
|
+
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
6
|
+
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
7
|
+
* `hidden` flag on individual data items; for other series types the data
|
|
8
|
+
* elements are scalars or objects without that field, and this helper returns
|
|
9
|
+
* the proposed index unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export function findVisibleDataIndex({
|
|
12
|
+
processedSeries,
|
|
13
|
+
type,
|
|
14
|
+
seriesId,
|
|
15
|
+
startIndex,
|
|
16
|
+
dataLength,
|
|
17
|
+
direction,
|
|
18
|
+
allowCycles
|
|
19
|
+
}) {
|
|
20
|
+
if (dataLength <= 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
24
|
+
if (seriesItem && 'hidden' in seriesItem && seriesItem.hidden) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const seriesData = seriesItem?.data;
|
|
28
|
+
const isIndexHidden = idx => {
|
|
29
|
+
if (!seriesData) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const item = seriesData[idx];
|
|
33
|
+
return typeof item === 'object' && item !== null && 'hidden' in item && Boolean(item.hidden);
|
|
34
|
+
};
|
|
35
|
+
let dataIndex = startIndex;
|
|
36
|
+
for (let attempt = 0; attempt < dataLength; attempt += 1) {
|
|
37
|
+
if (dataIndex >= 0 && dataIndex < dataLength && !isIndexHidden(dataIndex)) {
|
|
38
|
+
return dataIndex;
|
|
39
|
+
}
|
|
40
|
+
if (allowCycles) {
|
|
41
|
+
dataIndex = (dataIndex + direction + dataLength) % dataLength;
|
|
42
|
+
} else {
|
|
43
|
+
const next = dataIndex + direction;
|
|
44
|
+
if (next < 0 || next >= dataLength) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
dataIndex = next;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js
CHANGED
|
@@ -7,6 +7,12 @@ exports.getMaxSeriesLength = getMaxSeriesLength;
|
|
|
7
7
|
function getMaxSeriesLength(series, availableSeriesTypes) {
|
|
8
8
|
return Object.keys(series).filter(type => availableSeriesTypes.has(type)).flatMap(type => {
|
|
9
9
|
const seriesOfType = series[type];
|
|
10
|
-
return seriesOfType.seriesOrder.filter(seriesId =>
|
|
10
|
+
return seriesOfType.seriesOrder.filter(seriesId => {
|
|
11
|
+
const seriesItem = seriesOfType.series[seriesId];
|
|
12
|
+
if ('hidden' in seriesItem && seriesItem.hidden) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return seriesItem.data.length > 0 && seriesItem.data.some(value => value != null && !(typeof value === 'object' && 'hidden' in value && value.hidden));
|
|
16
|
+
}).map(seriesId => seriesOfType.series[seriesId].data.length);
|
|
11
17
|
}).reduce((maxLengths, length) => Math.max(maxLengths, length), 0);
|
|
12
18
|
}
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export function getMaxSeriesLength(series, availableSeriesTypes) {
|
|
2
2
|
return Object.keys(series).filter(type => availableSeriesTypes.has(type)).flatMap(type => {
|
|
3
3
|
const seriesOfType = series[type];
|
|
4
|
-
return seriesOfType.seriesOrder.filter(seriesId =>
|
|
4
|
+
return seriesOfType.seriesOrder.filter(seriesId => {
|
|
5
|
+
const seriesItem = seriesOfType.series[seriesId];
|
|
6
|
+
if ('hidden' in seriesItem && seriesItem.hidden) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return seriesItem.data.length > 0 && seriesItem.data.some(value => value != null && !(typeof value === 'object' && 'hidden' in value && value.hidden));
|
|
10
|
+
}).map(seriesId => seriesOfType.series[seriesId].data.length);
|
|
5
11
|
}).reduce((maxLengths, length) => Math.max(maxLengths, length), 0);
|
|
6
12
|
}
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js
CHANGED
|
@@ -7,7 +7,13 @@ exports.getNonEmptySeriesArray = getNonEmptySeriesArray;
|
|
|
7
7
|
function getNonEmptySeriesArray(series, availableSeriesTypes) {
|
|
8
8
|
return Object.keys(series).filter(type => availableSeriesTypes.has(type)).flatMap(type => {
|
|
9
9
|
const seriesOfType = series[type];
|
|
10
|
-
return seriesOfType.seriesOrder.filter(seriesId =>
|
|
10
|
+
return seriesOfType.seriesOrder.filter(seriesId => {
|
|
11
|
+
const seriesItem = seriesOfType.series[seriesId];
|
|
12
|
+
if ('hidden' in seriesItem && seriesItem.hidden) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return seriesItem.data.length > 0 && seriesItem.data.some(value => value != null);
|
|
16
|
+
}).map(seriesId => ({
|
|
11
17
|
type,
|
|
12
18
|
seriesId
|
|
13
19
|
}));
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.mjs
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export function getNonEmptySeriesArray(series, availableSeriesTypes) {
|
|
2
2
|
return Object.keys(series).filter(type => availableSeriesTypes.has(type)).flatMap(type => {
|
|
3
3
|
const seriesOfType = series[type];
|
|
4
|
-
return seriesOfType.seriesOrder.filter(seriesId =>
|
|
4
|
+
return seriesOfType.seriesOrder.filter(seriesId => {
|
|
5
|
+
const seriesItem = seriesOfType.series[seriesId];
|
|
6
|
+
if ('hidden' in seriesItem && seriesItem.hidden) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return seriesItem.data.length > 0 && seriesItem.data.some(value => value != null);
|
|
10
|
+
}).map(seriesId => ({
|
|
5
11
|
type,
|
|
6
12
|
seriesId
|
|
7
13
|
}));
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type
|
|
1
|
+
import type { ScaleName } from "../../../../models/index.mjs";
|
|
2
|
+
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type PolarAxisConfig } from "../../../../models/axis.mjs";
|
|
3
3
|
import { type ChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
4
4
|
import type { ChartDrawingArea } from "../../../../hooks/index.mjs";
|
|
5
5
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
6
6
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
7
7
|
import { type ComputedAxisConfig } from "../useChartCartesianAxis/index.mjs";
|
|
8
|
-
export type DefaultizedAxisConfig<AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
9
|
-
[axisId: AxisId]: PolarAxisDefaultized<ScaleName, any, AxisProps>;
|
|
10
|
-
};
|
|
11
8
|
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
12
9
|
axis: ComputedAxisConfig<T>;
|
|
13
10
|
axisIds: string[];
|
|
@@ -18,11 +15,11 @@ type ComputeCommonParams<SeriesType extends ChartSeriesType = ChartSeriesType> =
|
|
|
18
15
|
seriesConfig: ChartSeriesConfig<SeriesType>;
|
|
19
16
|
};
|
|
20
17
|
export declare function computeAxisValue<SeriesType extends ChartSeriesType>(options: ComputeCommonParams<SeriesType> & {
|
|
21
|
-
axis?:
|
|
18
|
+
axis?: PolarAxisConfig<ScaleName, any, ChartsRadiusAxisProps>[];
|
|
22
19
|
axisDirection: 'radius';
|
|
23
20
|
}): ComputeResult<ChartsRadiusAxisProps>;
|
|
24
21
|
export declare function computeAxisValue<SeriesType extends ChartSeriesType>(options: ComputeCommonParams<SeriesType> & {
|
|
25
|
-
axis?:
|
|
22
|
+
axis?: PolarAxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
26
23
|
axisDirection: 'rotation';
|
|
27
24
|
}): ComputeResult<ChartsRotationAxisProps>;
|
|
28
25
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type
|
|
1
|
+
import type { ScaleName } from "../../../../models/index.js";
|
|
2
|
+
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type PolarAxisConfig } from "../../../../models/axis.js";
|
|
3
3
|
import { type ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
4
4
|
import type { ChartDrawingArea } from "../../../../hooks/index.js";
|
|
5
5
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
6
6
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
7
7
|
import { type ComputedAxisConfig } from "../useChartCartesianAxis/index.js";
|
|
8
|
-
export type DefaultizedAxisConfig<AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
9
|
-
[axisId: AxisId]: PolarAxisDefaultized<ScaleName, any, AxisProps>;
|
|
10
|
-
};
|
|
11
8
|
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
12
9
|
axis: ComputedAxisConfig<T>;
|
|
13
10
|
axisIds: string[];
|
|
@@ -18,11 +15,11 @@ type ComputeCommonParams<SeriesType extends ChartSeriesType = ChartSeriesType> =
|
|
|
18
15
|
seriesConfig: ChartSeriesConfig<SeriesType>;
|
|
19
16
|
};
|
|
20
17
|
export declare function computeAxisValue<SeriesType extends ChartSeriesType>(options: ComputeCommonParams<SeriesType> & {
|
|
21
|
-
axis?:
|
|
18
|
+
axis?: PolarAxisConfig<ScaleName, any, ChartsRadiusAxisProps>[];
|
|
22
19
|
axisDirection: 'radius';
|
|
23
20
|
}): ComputeResult<ChartsRadiusAxisProps>;
|
|
24
21
|
export declare function computeAxisValue<SeriesType extends ChartSeriesType>(options: ComputeCommonParams<SeriesType> & {
|
|
25
|
-
axis?:
|
|
22
|
+
axis?: PolarAxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
26
23
|
axisDirection: 'rotation';
|
|
27
24
|
}): ComputeResult<ChartsRotationAxisProps>;
|
|
28
25
|
export {};
|
|
@@ -133,7 +133,8 @@ function computeAxisValue({
|
|
|
133
133
|
scaleType: scaleType,
|
|
134
134
|
scale: finalScale.domain(domain),
|
|
135
135
|
tickNumber,
|
|
136
|
-
colorScale: axis.colorMap && (0, _colorScale.getColorScale)(axis.colorMap)
|
|
136
|
+
colorScale: axis.colorMap && (0, _colorScale.getColorScale)(axis.colorMap),
|
|
137
|
+
isFullCircle
|
|
137
138
|
});
|
|
138
139
|
});
|
|
139
140
|
return {
|
|
@@ -126,7 +126,8 @@ export function computeAxisValue({
|
|
|
126
126
|
scaleType: scaleType,
|
|
127
127
|
scale: finalScale.domain(domain),
|
|
128
128
|
tickNumber,
|
|
129
|
-
colorScale: axis.colorMap && getColorScale(axis.colorMap)
|
|
129
|
+
colorScale: axis.colorMap && getColorScale(axis.colorMap),
|
|
130
|
+
isFullCircle
|
|
130
131
|
});
|
|
131
132
|
});
|
|
132
133
|
return {
|