@mui/x-charts 9.1.0 → 9.3.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/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 +221 -0
- package/ChartsContainer/ChartsContainer.js +9 -9
- package/ChartsContainer/ChartsContainer.mjs +9 -9
- package/ChartsLabel/ChartsLabelMark.js +0 -2
- package/ChartsLabel/ChartsLabelMark.mjs +0 -2
- 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/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +31 -14
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +32 -15
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -47
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -47
- package/ChartsRadiusAxis/ChartsRadiusAxis.js +20 -16
- package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +21 -15
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -47
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -47
- package/ChartsRotationAxis/ChartsRotationAxis.js +16 -19
- package/ChartsRotationAxis/ChartsRotationAxis.mjs +17 -18
- package/ChartsTooltip/useAxesTooltip.d.mts +1 -1
- package/ChartsTooltip/useAxesTooltip.d.ts +1 -1
- package/ChartsTooltip/useAxesTooltip.js +11 -2
- package/ChartsTooltip/useAxesTooltip.mjs +12 -3
- package/ChartsXAxis/ChartsXAxis.js +3 -1
- package/ChartsXAxis/ChartsXAxis.mjs +3 -1
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/ChartsYAxis/ChartsYAxis.mjs +3 -1
- package/LineChart/LineChart.js +6 -6
- package/LineChart/LineChart.mjs +6 -6
- package/LineChart/seriesConfig/curveEvaluation.js +12 -1
- package/LineChart/seriesConfig/curveEvaluation.mjs +12 -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/PieChart/PieChart.js +6 -6
- package/PieChart/PieChart.mjs +6 -6
- 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/RadarGrid/CircularRadarStripes.js +2 -3
- package/RadarChart/RadarGrid/CircularRadarStripes.mjs +2 -3
- 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/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -1
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.mjs +2 -2
- package/ScatterChart/ScatterChart.js +11 -11
- package/ScatterChart/ScatterChart.mjs +11 -11
- package/ScatterChart/seriesConfig/tooltip.js +2 -24
- package/ScatterChart/seriesConfig/tooltip.mjs +2 -24
- package/SparkLineChart/SparkLineChart.js +27 -27
- package/SparkLineChart/SparkLineChart.mjs +27 -27
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -1
- 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/getRingPath.d.mts +16 -0
- package/internals/getRingPath.d.ts +16 -0
- package/internals/getRingPath.js +39 -0
- package/internals/getRingPath.mjs +33 -0
- package/internals/index.d.mts +7 -2
- package/internals/index.d.ts +7 -2
- package/internals/index.js +46 -3
- package/internals/index.mjs +6 -2
- 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.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +8 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.mts +6 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +48 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.mjs +47 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +74 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +74 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +152 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +152 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +3 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +3 -0
- 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 +6 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +36 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +34 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +22 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +22 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +73 -12
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.mjs +74 -12
- 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/models/axis.d.mts +55 -7
- package/models/axis.d.ts +55 -7
- package/package.json +3 -3
|
@@ -39,7 +39,157 @@ export declare const selectorChartsHighlightYAxisValue: (args_0: import("../../c
|
|
|
39
39
|
}[] | AxisHighlightWithValue[];
|
|
40
40
|
export declare const selectorChartsHighlightXAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
41
41
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
42
|
-
}) => import("../../../index.js").
|
|
42
|
+
}) => ((Omit<Omit<import("../../../index.js").DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>, "scaleType">, "offset"> & Required<Pick<Omit<import("../../../index.js").DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>, "scaleType">, "offset">> & (({
|
|
43
|
+
scaleType: "linear";
|
|
44
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLinear<number, number>;
|
|
45
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
46
|
+
} | {
|
|
47
|
+
scaleType: "time";
|
|
48
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
49
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
50
|
+
} | {
|
|
51
|
+
scaleType: "log";
|
|
52
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
53
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
54
|
+
} | ({
|
|
55
|
+
scaleType: "band";
|
|
56
|
+
ordinalTimeTicks?: import("../../../../index.js").OrdinalTimeTicks;
|
|
57
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
58
|
+
toString(): string;
|
|
59
|
+
}>;
|
|
60
|
+
categoryGapRatio: number;
|
|
61
|
+
barGapRatio: number;
|
|
62
|
+
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
63
|
+
} & import("../../../index.js").AxisGroups & Pick<import("../../../../hooks/useTicks.js").TickParams, "tickPlacement" | "tickLabelPlacement">) | ({
|
|
64
|
+
scaleType: "point";
|
|
65
|
+
ordinalTimeTicks?: import("../../../../index.js").OrdinalTimeTicks;
|
|
66
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
67
|
+
toString(): string;
|
|
68
|
+
}>;
|
|
69
|
+
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
70
|
+
} & import("../../../index.js").AxisGroups) | {
|
|
71
|
+
scaleType: "symlog";
|
|
72
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleSymLog<number, number>;
|
|
73
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
74
|
+
constant?: number;
|
|
75
|
+
} | {
|
|
76
|
+
scaleType: "pow";
|
|
77
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePower<number, number>;
|
|
78
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
79
|
+
} | {
|
|
80
|
+
scaleType: "sqrt";
|
|
81
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePower<number, number>;
|
|
82
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
83
|
+
} | {
|
|
84
|
+
scaleType: "utc";
|
|
85
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
86
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
87
|
+
}) & ({
|
|
88
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
89
|
+
} | {
|
|
90
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
91
|
+
} | {
|
|
92
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
93
|
+
} | {
|
|
94
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<number, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
95
|
+
} | {
|
|
96
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<number, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
97
|
+
} | {
|
|
98
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
99
|
+
} | {
|
|
100
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
101
|
+
} | {
|
|
102
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
103
|
+
} | {
|
|
104
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
105
|
+
}))) & {
|
|
106
|
+
tickNumber: number;
|
|
107
|
+
triggerTooltip?: boolean;
|
|
108
|
+
isFullCircle?: boolean;
|
|
109
|
+
} & ChartsAxisProps & {
|
|
110
|
+
position?: "none" | "bottom" | "left" | "right" | "top" | undefined;
|
|
111
|
+
height?: number | "auto" | undefined;
|
|
112
|
+
width?: number | "auto" | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
height: number;
|
|
115
|
+
} & {
|
|
116
|
+
width: number;
|
|
117
|
+
})[];
|
|
43
118
|
export declare const selectorChartsHighlightYAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
44
119
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
45
|
-
}) => import("../../../index.js").
|
|
120
|
+
}) => ((Omit<Omit<import("../../../index.js").DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>, "scaleType">, "offset"> & Required<Pick<Omit<import("../../../index.js").DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>, "scaleType">, "offset">> & (({
|
|
121
|
+
scaleType: "linear";
|
|
122
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLinear<number, number>;
|
|
123
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
124
|
+
} | {
|
|
125
|
+
scaleType: "time";
|
|
126
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
127
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
128
|
+
} | {
|
|
129
|
+
scaleType: "log";
|
|
130
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
131
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
132
|
+
} | ({
|
|
133
|
+
scaleType: "band";
|
|
134
|
+
ordinalTimeTicks?: import("../../../../index.js").OrdinalTimeTicks;
|
|
135
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
136
|
+
toString(): string;
|
|
137
|
+
}>;
|
|
138
|
+
categoryGapRatio: number;
|
|
139
|
+
barGapRatio: number;
|
|
140
|
+
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
141
|
+
} & import("../../../index.js").AxisGroups & Pick<import("../../../../hooks/useTicks.js").TickParams, "tickPlacement" | "tickLabelPlacement">) | ({
|
|
142
|
+
scaleType: "point";
|
|
143
|
+
ordinalTimeTicks?: import("../../../../index.js").OrdinalTimeTicks;
|
|
144
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
145
|
+
toString(): string;
|
|
146
|
+
}>;
|
|
147
|
+
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
148
|
+
} & import("../../../index.js").AxisGroups) | {
|
|
149
|
+
scaleType: "symlog";
|
|
150
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleSymLog<number, number>;
|
|
151
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
152
|
+
constant?: number;
|
|
153
|
+
} | {
|
|
154
|
+
scaleType: "pow";
|
|
155
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePower<number, number>;
|
|
156
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
157
|
+
} | {
|
|
158
|
+
scaleType: "sqrt";
|
|
159
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScalePower<number, number>;
|
|
160
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
161
|
+
} | {
|
|
162
|
+
scaleType: "utc";
|
|
163
|
+
scale: import("@mui/x-charts-vendor/d3-scale").ScaleTime<number, number>;
|
|
164
|
+
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
165
|
+
}) & ({
|
|
166
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
167
|
+
} | {
|
|
168
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
169
|
+
} | {
|
|
170
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
171
|
+
} | {
|
|
172
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<number, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
173
|
+
} | {
|
|
174
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleOrdinal<number, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
175
|
+
} | {
|
|
176
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
177
|
+
} | {
|
|
178
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
179
|
+
} | {
|
|
180
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number, string | null>;
|
|
181
|
+
} | {
|
|
182
|
+
colorScale?: import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string | null>;
|
|
183
|
+
}))) & {
|
|
184
|
+
tickNumber: number;
|
|
185
|
+
triggerTooltip?: boolean;
|
|
186
|
+
isFullCircle?: boolean;
|
|
187
|
+
} & ChartsAxisProps & {
|
|
188
|
+
position?: "none" | "bottom" | "left" | "right" | "top" | undefined;
|
|
189
|
+
height?: number | "auto" | undefined;
|
|
190
|
+
width?: number | "auto" | undefined;
|
|
191
|
+
} & {
|
|
192
|
+
height: number;
|
|
193
|
+
} & {
|
|
194
|
+
width: number;
|
|
195
|
+
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChartsCartesianAxisProps, AxisId } from "../../../../models/axis.mjs";
|
|
2
2
|
import { type ComputeResult } from "./computeAxisValue.mjs";
|
|
3
|
-
export declare const selectChartsInteractionAxisIndex: (value: number | null, axes: ComputeResult<
|
|
3
|
+
export declare const selectChartsInteractionAxisIndex: (value: number | null, axes: ComputeResult<ChartsCartesianAxisProps>, id: AxisId | undefined) => number | null;
|
|
4
4
|
export declare const selectorChartsInteractionXAxisIndex: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
5
5
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
6
6
|
}, id: AxisId | undefined) => number | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChartsCartesianAxisProps, AxisId } from "../../../../models/axis.js";
|
|
2
2
|
import { type ComputeResult } from "./computeAxisValue.js";
|
|
3
|
-
export declare const selectChartsInteractionAxisIndex: (value: number | null, axes: ComputeResult<
|
|
3
|
+
export declare const selectChartsInteractionAxisIndex: (value: number | null, axes: ComputeResult<ChartsCartesianAxisProps>, id: AxisId | undefined) => number | null;
|
|
4
4
|
export declare const selectorChartsInteractionXAxisIndex: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
}, id: AxisId | undefined) => number | null;
|
|
@@ -25,6 +25,9 @@ const useChartHighlight = ({
|
|
|
25
25
|
defaultValue: null
|
|
26
26
|
});
|
|
27
27
|
(0, _useEnhancedEffect.default)(() => {
|
|
28
|
+
if (params.highlightedItem === undefined) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
28
31
|
if (store.state.highlight.item !== params.highlightedItem) {
|
|
29
32
|
if (params.highlightedItem === null) {
|
|
30
33
|
store.set('highlight', (0, _extends2.default)({}, store.state.highlight, {
|
|
@@ -18,6 +18,9 @@ export const useChartHighlight = ({
|
|
|
18
18
|
defaultValue: null
|
|
19
19
|
});
|
|
20
20
|
useEnhancedEffect(() => {
|
|
21
|
+
if (params.highlightedItem === undefined) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
21
24
|
if (store.state.highlight.item !== params.highlightedItem) {
|
|
22
25
|
if (params.highlightedItem === null) {
|
|
23
26
|
store.set('highlight', _extends({}, store.state.highlight, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartsRadialAxisProps, ScaleName, PolarAxisConfig } from "../../../../models/axis.mjs";
|
|
2
2
|
import { type PolarChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
3
3
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
4
4
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
5
|
-
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any,
|
|
5
|
+
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection: "rotation" | "radius", seriesConfig: ChartSeriesConfig<SeriesType>, axisIndex: number, formattedSeries: ProcessedSeries<SeriesType>) => number[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartsRadialAxisProps, ScaleName, PolarAxisConfig } from "../../../../models/axis.js";
|
|
2
2
|
import { type PolarChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
3
3
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
4
4
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
5
|
-
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any,
|
|
5
|
+
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection: "rotation" | "radius", seriesConfig: ChartSeriesConfig<SeriesType>, axisIndex: number, formattedSeries: ProcessedSeries<SeriesType>) => number[];
|
|
@@ -3,4 +3,9 @@ import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedAxis, Scal
|
|
|
3
3
|
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
4
4
|
* Returns `-1` if the coordinate does not match a value.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getRotationAxisIndex(axisConfig: ComputedAxis<ScaleName, any, ChartsRotationAxisProps>, pointerValue: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
9
|
+
* Returns `-1` if the coordinate does not match a value.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getRadiusAxisIndex(axisConfig: ComputedAxis<ScaleName, any, ChartsRadiusAxisProps>, pointerValue: number): number;
|
|
@@ -3,4 +3,9 @@ import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedAxis, Scal
|
|
|
3
3
|
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
4
4
|
* Returns `-1` if the coordinate does not match a value.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getRotationAxisIndex(axisConfig: ComputedAxis<ScaleName, any, ChartsRotationAxisProps>, pointerValue: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
9
|
+
* Returns `-1` if the coordinate does not match a value.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getRadiusAxisIndex(axisConfig: ComputedAxis<ScaleName, any, ChartsRadiusAxisProps>, pointerValue: number): number;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getRadiusAxisIndex = getRadiusAxisIndex;
|
|
7
|
+
exports.getRotationAxisIndex = getRotationAxisIndex;
|
|
7
8
|
var _scaleGuards = require("../../../scaleGuards");
|
|
8
9
|
var _getAsNumber = require("../../../getAsNumber");
|
|
9
10
|
var _findClosestIndex = require("../../../findClosestIndex");
|
|
@@ -12,7 +13,7 @@ var _clampAngle = require("../../../clampAngle");
|
|
|
12
13
|
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
13
14
|
* Returns `-1` if the coordinate does not match a value.
|
|
14
15
|
*/
|
|
15
|
-
function
|
|
16
|
+
function getRotationAxisIndex(axisConfig, pointerValue) {
|
|
16
17
|
const {
|
|
17
18
|
scale,
|
|
18
19
|
data: axisData,
|
|
@@ -51,4 +52,37 @@ function getAxisIndex(axisConfig, pointerValue) {
|
|
|
51
52
|
return -1;
|
|
52
53
|
}
|
|
53
54
|
return reverse ? axisData.length - 1 - dataIndex : dataIndex;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
59
|
+
* Returns `-1` if the coordinate does not match a value.
|
|
60
|
+
*/
|
|
61
|
+
function getRadiusAxisIndex(axisConfig, pointerValue) {
|
|
62
|
+
const {
|
|
63
|
+
scale,
|
|
64
|
+
data: axisData,
|
|
65
|
+
reverse
|
|
66
|
+
} = axisConfig;
|
|
67
|
+
if (!(0, _scaleGuards.isOrdinalScale)(scale)) {
|
|
68
|
+
if (axisData === undefined) {
|
|
69
|
+
return -1;
|
|
70
|
+
}
|
|
71
|
+
const valueAsNumber = (0, _getAsNumber.getAsNumber)(scale.invert(pointerValue));
|
|
72
|
+
return (0, _findClosestIndex.findClosestIndex)(axisData, valueAsNumber);
|
|
73
|
+
}
|
|
74
|
+
if (!axisData) {
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
let dataIndex;
|
|
78
|
+
const distFromStart = pointerValue - Math.min(...scale.range());
|
|
79
|
+
if (scale.bandwidth() === 0) {
|
|
80
|
+
dataIndex = Math.floor((distFromStart + scale.step() / 2) / scale.step());
|
|
81
|
+
} else {
|
|
82
|
+
dataIndex = Math.floor(distFromStart / scale.step());
|
|
83
|
+
}
|
|
84
|
+
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
85
|
+
return -1;
|
|
86
|
+
}
|
|
87
|
+
return reverse ? axisData.length - 1 - dataIndex : dataIndex;
|
|
54
88
|
}
|
|
@@ -7,7 +7,7 @@ import { clampAngleRad } from "../../../clampAngle.mjs";
|
|
|
7
7
|
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
8
8
|
* Returns `-1` if the coordinate does not match a value.
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
10
|
+
export function getRotationAxisIndex(axisConfig, pointerValue) {
|
|
11
11
|
const {
|
|
12
12
|
scale,
|
|
13
13
|
data: axisData,
|
|
@@ -46,4 +46,37 @@ export function getAxisIndex(axisConfig, pointerValue) {
|
|
|
46
46
|
return -1;
|
|
47
47
|
}
|
|
48
48
|
return reverse ? axisData.length - 1 - dataIndex : dataIndex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
53
|
+
* Returns `-1` if the coordinate does not match a value.
|
|
54
|
+
*/
|
|
55
|
+
export function getRadiusAxisIndex(axisConfig, pointerValue) {
|
|
56
|
+
const {
|
|
57
|
+
scale,
|
|
58
|
+
data: axisData,
|
|
59
|
+
reverse
|
|
60
|
+
} = axisConfig;
|
|
61
|
+
if (!isOrdinalScale(scale)) {
|
|
62
|
+
if (axisData === undefined) {
|
|
63
|
+
return -1;
|
|
64
|
+
}
|
|
65
|
+
const valueAsNumber = getAsNumber(scale.invert(pointerValue));
|
|
66
|
+
return findClosestIndex(axisData, valueAsNumber);
|
|
67
|
+
}
|
|
68
|
+
if (!axisData) {
|
|
69
|
+
return -1;
|
|
70
|
+
}
|
|
71
|
+
let dataIndex;
|
|
72
|
+
const distFromStart = pointerValue - Math.min(...scale.range());
|
|
73
|
+
if (scale.bandwidth() === 0) {
|
|
74
|
+
dataIndex = Math.floor((distFromStart + scale.step() / 2) / scale.step());
|
|
75
|
+
} else {
|
|
76
|
+
dataIndex = Math.floor(distFromStart / scale.step());
|
|
77
|
+
}
|
|
78
|
+
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
79
|
+
return -1;
|
|
80
|
+
}
|
|
81
|
+
return reverse ? axisData.length - 1 - dataIndex : dataIndex;
|
|
49
82
|
}
|
|
@@ -177,7 +177,7 @@ const useChartPolarAxis = ({
|
|
|
177
177
|
let isRotationAxis = false;
|
|
178
178
|
const svgPoint = (0, _getChartPoint.getChartPoint)(element, event.detail.srcEvent);
|
|
179
179
|
const rotation = (0, _coordinateTransformation.generateSvg2rotation)(center)(svgPoint.x, svgPoint.y);
|
|
180
|
-
const rotationIndex = (0, _getAxisIndex.
|
|
180
|
+
const rotationIndex = (0, _getAxisIndex.getRotationAxisIndex)(rotationAxisWithScale[usedRotationAxisId], rotation);
|
|
181
181
|
isRotationAxis = rotationIndex !== -1;
|
|
182
182
|
dataIndex = isRotationAxis ? rotationIndex : null; // radius index is not yet implemented.
|
|
183
183
|
|
|
@@ -9,7 +9,7 @@ import { selectorChartsInteractionIsInitialized } from "../useChartInteraction/i
|
|
|
9
9
|
import { selectorChartPolarCenter, selectorChartRadiusAxis, selectorChartRotationAxis } from "./useChartPolarAxis.selectors.mjs";
|
|
10
10
|
import { getChartPoint } from "../../../getChartPoint.mjs";
|
|
11
11
|
import { generatePolar2svg, generateSvg2polar, generateSvg2rotation } from "./coordinateTransformation.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { getRotationAxisIndex } from "./getAxisIndex.mjs";
|
|
13
13
|
import { selectorChartSeriesProcessed } from "../../corePlugins/useChartSeries/index.mjs";
|
|
14
14
|
import { checkHasInteractionPlugin } from "../useChartInteraction/checkHasInteractionPlugin.mjs";
|
|
15
15
|
export const useChartPolarAxis = ({
|
|
@@ -170,7 +170,7 @@ export const useChartPolarAxis = ({
|
|
|
170
170
|
let isRotationAxis = false;
|
|
171
171
|
const svgPoint = getChartPoint(element, event.detail.srcEvent);
|
|
172
172
|
const rotation = generateSvg2rotation(center)(svgPoint.x, svgPoint.y);
|
|
173
|
-
const rotationIndex =
|
|
173
|
+
const rotationIndex = getRotationAxisIndex(rotationAxisWithScale[usedRotationAxisId], rotation);
|
|
174
174
|
isRotationAxis = rotationIndex !== -1;
|
|
175
175
|
dataIndex = isRotationAxis ? rotationIndex : null; // radius index is not yet implemented.
|
|
176
176
|
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts
CHANGED
|
@@ -18,9 +18,29 @@ export declare const selectorChartsInteractionTooltipRotationAxes: (args_0: impo
|
|
|
18
18
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
19
19
|
}) => AxisItemIdentifier[];
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Helper to get the radius associated to the interaction coordinate.
|
|
22
22
|
*/
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const selectorChartsInteractionRadius: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
24
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
25
|
+
}) => number | null;
|
|
26
|
+
export declare const selectorChartsInteractionRadiusAxisIndex: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
27
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
28
|
+
}) => number | null;
|
|
29
|
+
export declare const selectorChartsInteractionRadiusAxisIndexes: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
30
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
31
|
+
}) => number[] | null;
|
|
32
|
+
export declare const selectorChartsInteractionRadiusAxisValue: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.mjs").UseChartPolarAxisState> & {
|
|
33
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
34
|
+
}) => any;
|
|
35
|
+
export declare const selectorChartsInteractionRadiusAxisValues: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.mjs").UseChartPolarAxisState> & {
|
|
36
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
37
|
+
}) => any[] | null;
|
|
38
|
+
/**
|
|
39
|
+
* Get radius-axis ids and corresponding data index that should be display in the tooltip.
|
|
40
|
+
*/
|
|
41
|
+
export declare const selectorChartsInteractionTooltipRadiusAxes: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
42
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
43
|
+
}) => AxisItemIdentifier[];
|
|
24
44
|
/**
|
|
25
45
|
* Return `true` if the axis tooltip has something to display.
|
|
26
46
|
*/
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts
CHANGED
|
@@ -18,9 +18,29 @@ export declare const selectorChartsInteractionTooltipRotationAxes: (args_0: impo
|
|
|
18
18
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
19
19
|
}) => AxisItemIdentifier[];
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Helper to get the radius associated to the interaction coordinate.
|
|
22
22
|
*/
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const selectorChartsInteractionRadius: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
24
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
25
|
+
}) => number | null;
|
|
26
|
+
export declare const selectorChartsInteractionRadiusAxisIndex: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
27
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
|
+
}) => number | null;
|
|
29
|
+
export declare const selectorChartsInteractionRadiusAxisIndexes: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
30
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
31
|
+
}) => number[] | null;
|
|
32
|
+
export declare const selectorChartsInteractionRadiusAxisValue: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
33
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
34
|
+
}) => any;
|
|
35
|
+
export declare const selectorChartsInteractionRadiusAxisValues: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
36
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
37
|
+
}) => any[] | null;
|
|
38
|
+
/**
|
|
39
|
+
* Get radius-axis ids and corresponding data index that should be display in the tooltip.
|
|
40
|
+
*/
|
|
41
|
+
export declare const selectorChartsInteractionTooltipRadiusAxes: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
42
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
43
|
+
}) => AxisItemIdentifier[];
|
|
24
44
|
/**
|
|
25
45
|
* Return `true` if the axis tooltip has something to display.
|
|
26
46
|
*/
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectorChartsInteractionTooltipRotationAxes = exports.selectorChartsInteractionTooltipRadiusAxes = exports.selectorChartsInteractionRotationAxisValues = exports.selectorChartsInteractionRotationAxisValue = exports.selectorChartsInteractionRotationAxisIndexes = exports.selectorChartsInteractionRotationAxisIndex = exports.selectorChartsInteractionPolarAxisTooltip = void 0;
|
|
6
|
+
exports.selectorChartsInteractionTooltipRotationAxes = exports.selectorChartsInteractionTooltipRadiusAxes = exports.selectorChartsInteractionRotationAxisValues = exports.selectorChartsInteractionRotationAxisValue = exports.selectorChartsInteractionRotationAxisIndexes = exports.selectorChartsInteractionRotationAxisIndex = exports.selectorChartsInteractionRadiusAxisValues = exports.selectorChartsInteractionRadiusAxisValue = exports.selectorChartsInteractionRadiusAxisIndexes = exports.selectorChartsInteractionRadiusAxisIndex = exports.selectorChartsInteractionRadius = exports.selectorChartsInteractionPolarAxisTooltip = void 0;
|
|
7
7
|
var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
|
|
8
8
|
var _store = require("@mui/x-internals/store");
|
|
9
9
|
var _useChartInteraction = require("../useChartInteraction/useChartInteraction.selectors");
|
|
@@ -17,10 +17,17 @@ const optionalGetAxisIds = (_, ids) => ids;
|
|
|
17
17
|
* Get interaction indexes
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
function indexGetter(value, axes, ids) {
|
|
21
|
-
|
|
20
|
+
function indexGetter(value, axes, ids, type) {
|
|
21
|
+
if (type === 'rotation') {
|
|
22
|
+
const rotationAxes = axes;
|
|
23
|
+
return Array.isArray(ids) ? ids.map(id => (0, _getAxisIndex.getRotationAxisIndex)(rotationAxes.axis[id], value)) : (0, _getAxisIndex.getRotationAxisIndex)(rotationAxes.axis[ids], value);
|
|
24
|
+
}
|
|
25
|
+
const radiusAxes = axes;
|
|
26
|
+
return Array.isArray(ids) ? ids.map(id => (0, _getAxisIndex.getRadiusAxisIndex)(radiusAxes.axis[id], value)) : (0, _getAxisIndex.getRadiusAxisIndex)(radiusAxes.axis[ids], value);
|
|
22
27
|
}
|
|
23
28
|
|
|
29
|
+
// ============================= Rotation axis =============================
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* Helper to get the rotation associated to the interaction coordinate.
|
|
26
33
|
*/
|
|
@@ -30,8 +37,8 @@ const selectorChartsInteractionRotationAngle = (0, _store.createSelector)(_useCh
|
|
|
30
37
|
}
|
|
31
38
|
return (0, _coordinateTransformation.generateSvg2rotation)(center)(x, y);
|
|
32
39
|
});
|
|
33
|
-
const selectorChartsInteractionRotationAxisIndex = exports.selectorChartsInteractionRotationAxisIndex = (0, _store.createSelector)(selectorChartsInteractionRotationAngle, _useChartPolarAxis.selectorChartRotationAxis, optionalGetAxisId, (rotation, rotationAxis, id) => rotation === null ? null : indexGetter(rotation, rotationAxis, id ?? rotationAxis.axisIds[0]));
|
|
34
|
-
const selectorChartsInteractionRotationAxisIndexes = exports.selectorChartsInteractionRotationAxisIndexes = (0, _store.createSelector)(selectorChartsInteractionRotationAngle, _useChartPolarAxis.selectorChartRotationAxis, optionalGetAxisIds, (rotation, rotationAxis, ids) => rotation === null ? null : indexGetter(rotation, rotationAxis, ids ?? rotationAxis.axisIds));
|
|
40
|
+
const selectorChartsInteractionRotationAxisIndex = exports.selectorChartsInteractionRotationAxisIndex = (0, _store.createSelector)(selectorChartsInteractionRotationAngle, _useChartPolarAxis.selectorChartRotationAxis, optionalGetAxisId, (rotation, rotationAxis, id) => rotation === null ? null : indexGetter(rotation, rotationAxis, id ?? rotationAxis.axisIds[0], 'rotation'));
|
|
41
|
+
const selectorChartsInteractionRotationAxisIndexes = exports.selectorChartsInteractionRotationAxisIndexes = (0, _store.createSelector)(selectorChartsInteractionRotationAngle, _useChartPolarAxis.selectorChartRotationAxis, optionalGetAxisIds, (rotation, rotationAxis, ids) => rotation === null ? null : indexGetter(rotation, rotationAxis, ids ?? rotationAxis.axisIds, 'rotation'));
|
|
35
42
|
const selectorChartsInteractionRotationAxisValue = exports.selectorChartsInteractionRotationAxisValue = (0, _store.createSelector)(_useChartPolarAxis.selectorChartRotationAxis, selectorChartsInteractionRotationAxisIndex, optionalGetAxisId, (rotationAxis, rotationIndex, id) => {
|
|
36
43
|
id = id ?? rotationAxis.axisIds[0];
|
|
37
44
|
if (rotationIndex === null || rotationIndex === -1 || rotationAxis.axisIds.length === 0) {
|
|
@@ -80,16 +87,70 @@ const selectorChartsInteractionTooltipRotationAxes = exports.selectorChartsInter
|
|
|
80
87
|
}) => axes.axis[axisId].triggerTooltip && dataIndex >= 0);
|
|
81
88
|
});
|
|
82
89
|
|
|
90
|
+
// ============================= Radius axis =============================
|
|
91
|
+
|
|
83
92
|
/**
|
|
84
|
-
*
|
|
93
|
+
* Helper to get the radius associated to the interaction coordinate.
|
|
85
94
|
*/
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
95
|
+
const selectorChartsInteractionRadius = exports.selectorChartsInteractionRadius = (0, _store.createSelector)(_useChartInteraction.selectorChartsInteractionPointerX, _useChartInteraction.selectorChartsInteractionPointerY, _useChartPolarAxis.selectorChartPolarCenter, (x, y, center) => {
|
|
96
|
+
if (x === null || y === null) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return Math.sqrt((x - center.cx) ** 2 + (y - center.cy) ** 2);
|
|
100
|
+
});
|
|
101
|
+
const selectorChartsInteractionRadiusAxisIndex = exports.selectorChartsInteractionRadiusAxisIndex = (0, _store.createSelector)(selectorChartsInteractionRadius, _useChartPolarAxis.selectorChartRadiusAxis, optionalGetAxisId, (radius, radiusAxis, id) => radius === null ? null : indexGetter(radius, radiusAxis, id ?? radiusAxis.axisIds[0], 'radius'));
|
|
102
|
+
const selectorChartsInteractionRadiusAxisIndexes = exports.selectorChartsInteractionRadiusAxisIndexes = (0, _store.createSelector)(selectorChartsInteractionRadius, _useChartPolarAxis.selectorChartRadiusAxis, optionalGetAxisIds, (radius, radiusAxis, ids) => radius === null ? null : indexGetter(radius, radiusAxis, ids ?? radiusAxis.axisIds, 'radius'));
|
|
103
|
+
const selectorChartsInteractionRadiusAxisValue = exports.selectorChartsInteractionRadiusAxisValue = (0, _store.createSelector)(_useChartPolarAxis.selectorChartRadiusAxis, selectorChartsInteractionRadiusAxisIndex, optionalGetAxisId, (radiusAxis, radiusIndex, id) => {
|
|
104
|
+
id = id ?? radiusAxis.axisIds[0];
|
|
105
|
+
if (radiusIndex === null || radiusIndex === -1 || radiusAxis.axisIds.length === 0) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const data = radiusAxis.axis[id]?.data;
|
|
109
|
+
if (!data) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return data[radiusIndex];
|
|
113
|
+
});
|
|
114
|
+
const selectorChartsInteractionRadiusAxisValues = exports.selectorChartsInteractionRadiusAxisValues = (0, _store.createSelector)(_useChartPolarAxis.selectorChartRadiusAxis, selectorChartsInteractionRadiusAxisIndexes, optionalGetAxisIds, (radiusAxis, radiusIndexes, ids) => {
|
|
115
|
+
ids = ids ?? radiusAxis.axisIds;
|
|
116
|
+
if (radiusIndexes === null) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return ids.map((id, axisIndex) => {
|
|
120
|
+
const radiusIndex = radiusIndexes[axisIndex];
|
|
121
|
+
if (radiusIndex === -1) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
return radiusAxis.axis[id].data?.[radiusIndex];
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get radius-axis ids and corresponding data index that should be display in the tooltip.
|
|
130
|
+
*/
|
|
131
|
+
const selectorChartsInteractionTooltipRadiusAxes = exports.selectorChartsInteractionTooltipRadiusAxes = (0, _store.createSelectorMemoizedWithOptions)({
|
|
132
|
+
memoizeOptions: {
|
|
133
|
+
// Keep the same reference if array content is the same.
|
|
134
|
+
// If possible, avoid this pattern by creating selectors that
|
|
135
|
+
// uses string/number as arguments.
|
|
136
|
+
resultEqualityCheck: _isDeepEqual.isDeepEqual
|
|
137
|
+
}
|
|
138
|
+
})(selectorChartsInteractionRadiusAxisIndexes, _useChartPolarAxis.selectorChartRadiusAxis, (indexes, axes) => {
|
|
139
|
+
if (indexes === null) {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
return axes.axisIds.map((axisId, axisIndex) => ({
|
|
143
|
+
axisId,
|
|
144
|
+
dataIndex: indexes[axisIndex]
|
|
145
|
+
})).filter(({
|
|
146
|
+
axisId,
|
|
147
|
+
dataIndex
|
|
148
|
+
}) => axes.axis[axisId].triggerTooltip && dataIndex >= 0);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// ============================= Cross axes selectors =============================
|
|
90
152
|
|
|
91
153
|
/**
|
|
92
154
|
* Return `true` if the axis tooltip has something to display.
|
|
93
155
|
*/
|
|
94
|
-
exports.
|
|
95
|
-
const selectorChartsInteractionPolarAxisTooltip = exports.selectorChartsInteractionPolarAxisTooltip = (0, _store.createSelector)(selectorChartsInteractionTooltipRotationAxes, rotationTooltip => rotationTooltip.length > 0);
|
|
156
|
+
const selectorChartsInteractionPolarAxisTooltip = exports.selectorChartsInteractionPolarAxisTooltip = (0, _store.createSelector)(selectorChartsInteractionTooltipRotationAxes, selectorChartsInteractionTooltipRadiusAxes, (rotationTooltip, radiusTooltip) => rotationTooltip.length > 0 || radiusTooltip.length > 0);
|