@mui/x-charts 9.10.0 → 9.11.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 +4 -2
- package/BarChart/BarChart.mjs +4 -2
- package/BarChart/BarPlot.d.mts +3 -3
- package/BarChart/BarPlot.d.ts +3 -3
- package/BarChart/BarPlot.js +1 -1
- package/BarChart/BarPlot.mjs +1 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -2
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -2
- package/BarChart/IndividualBarPlot.d.mts +2 -2
- package/BarChart/IndividualBarPlot.d.ts +2 -2
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +4 -4
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +4 -4
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +3 -1
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.mjs +3 -1
- package/BarChart/useRegisterItemClickHandlers.d.mts +2 -1
- package/BarChart/useRegisterItemClickHandlers.d.ts +2 -1
- package/BarChart/useRegisterItemClickHandlers.js +8 -0
- package/BarChart/useRegisterItemClickHandlers.mjs +8 -1
- package/CHANGELOG.md +224 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +1 -1
- package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/getSampledBandHighlight.js +15 -3
- package/ChartsAxisHighlight/getSampledBandHighlight.mjs +15 -3
- package/ChartsContainer/ChartsContainer.js +4 -2
- package/ChartsContainer/ChartsContainer.mjs +4 -2
- package/ChartsDataProvider/ChartsDataProvider.js +3 -1
- package/ChartsDataProvider/ChartsDataProvider.mjs +3 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +3 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +101 -101
- package/ChartsXAxis/useAxisTicksProps.d.ts +101 -101
- package/ChartsYAxis/useAxisTicksProps.d.mts +101 -101
- package/ChartsYAxis/useAxisTicksProps.d.ts +101 -101
- package/LineChart/AreaPlot.d.mts +3 -2
- package/LineChart/AreaPlot.d.ts +3 -2
- package/LineChart/AreaPlot.js +8 -2
- package/LineChart/AreaPlot.mjs +9 -3
- package/LineChart/LineChart.js +2 -1
- package/LineChart/LineChart.mjs +2 -1
- package/LineChart/LinePlot.d.mts +3 -2
- package/LineChart/LinePlot.d.ts +3 -2
- package/LineChart/LinePlot.js +2 -2
- package/LineChart/LinePlot.mjs +3 -3
- package/LineChart/MarkPlot.d.mts +5 -4
- package/LineChart/MarkPlot.d.ts +5 -4
- package/LineChart/MarkPlot.js +17 -8
- package/LineChart/MarkPlot.mjs +17 -8
- package/LineChart/seriesConfig/keyboardFocusHandler.js +3 -1
- package/LineChart/seriesConfig/keyboardFocusHandler.mjs +3 -1
- package/LineChart/useLineItemClickHandler.d.mts +25 -1
- package/LineChart/useLineItemClickHandler.d.ts +25 -1
- package/LineChart/useLineItemClickHandler.js +48 -1
- package/LineChart/useLineItemClickHandler.mjs +47 -1
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.js +16 -1
- package/PieChart/PieArcPlot.mjs +16 -1
- package/PieChart/PieChart.js +3 -1
- package/PieChart/PieChart.mjs +3 -1
- package/PieChart/PiePlot.js +1 -1
- package/PieChart/PiePlot.mjs +1 -1
- package/README.md +1 -11
- package/RadarChart/RadarChart.js +3 -1
- package/RadarChart/RadarChart.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +4 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +4 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.mts +5 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +5 -4
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.mts +15 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.ts +15 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.js +32 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.mjs +26 -0
- package/RadarChart/seriesConfig/keyboardFocusHandler.js +3 -1
- package/RadarChart/seriesConfig/keyboardFocusHandler.mjs +3 -1
- package/RadarChart/useRadarChartProps.js +5 -1
- package/RadarChart/useRadarChartProps.mjs +5 -1
- package/ScatterChart/Scatter.d.mts +3 -2
- package/ScatterChart/Scatter.d.ts +3 -2
- package/ScatterChart/Scatter.js +10 -1
- package/ScatterChart/Scatter.mjs +10 -1
- package/ScatterChart/ScatterChart.js +1 -0
- package/ScatterChart/ScatterChart.mjs +1 -0
- package/ScatterChart/async/ScatterAsync.js +9 -0
- package/ScatterChart/async/ScatterAsync.mjs +9 -0
- package/SparkLineChart/SparkLineChart.js +2 -1
- package/SparkLineChart/SparkLineChart.mjs +2 -1
- package/Toolbar/ToolbarButton.js +1 -1
- package/Toolbar/ToolbarButton.mjs +1 -1
- package/hooks/animation/useAnimatePieArc.js +2 -1
- package/hooks/animation/useAnimatePieArc.mjs +2 -1
- package/hooks/useFocusedItem.d.mts +1 -1
- package/hooks/useFocusedItem.d.ts +1 -1
- package/hooks/useItemHighlightStateGetter.d.mts +1 -1
- package/hooks/useItemHighlightStateGetter.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/commonNextFocusItem.d.mts +2 -2
- package/internals/commonNextFocusItem.d.ts +2 -2
- package/internals/commonNextFocusItem.js +4 -4
- package/internals/commonNextFocusItem.mjs +4 -4
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -0
- package/internals/createCommonKeyboardFocusHandler.d.mts +2 -2
- package/internals/createCommonKeyboardFocusHandler.d.ts +2 -2
- package/internals/createGetBarDimensions.js +10 -5
- package/internals/createGetBarDimensions.mjs +10 -5
- package/internals/getSampledBucketRegion.d.mts +12 -0
- package/internals/getSampledBucketRegion.d.ts +12 -0
- package/internals/getSampledBucketRegion.js +23 -0
- package/internals/getSampledBucketRegion.mjs +17 -0
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/index.mjs +1 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +8 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +8 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +11 -3
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +11 -3
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +1 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.mts +12 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.ts +12 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.js +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.mjs +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +11 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +6 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.mts +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.ts +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.js +46 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.mjs +40 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +13 -31
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +13 -31
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +19 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +19 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +5 -3
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +5 -3
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.js +15 -0
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.mjs +14 -0
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.mts +5 -2
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +5 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +10 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.mts +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.ts +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.js +39 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.mjs +32 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -7
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +47 -7
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.mts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +2 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.mts +39 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +39 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs +3 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.mts +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.ts +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.js +36 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.mjs +30 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +19 -20
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +19 -20
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -1
- package/internals/seriesSelectorOfType.d.mts +4 -4
- package/internals/seriesSelectorOfType.d.ts +4 -4
- package/internals/snapEndAngleToFullCircle.d.mts +20 -0
- package/internals/snapEndAngleToFullCircle.d.ts +20 -0
- package/internals/snapEndAngleToFullCircle.js +47 -0
- package/internals/snapEndAngleToFullCircle.mjs +41 -0
- package/internals/useRegisterItemActivation.d.mts +23 -0
- package/internals/useRegisterItemActivation.d.ts +23 -0
- package/internals/useRegisterItemActivation.js +53 -0
- package/internals/useRegisterItemActivation.mjs +46 -0
- package/models/axis.d.mts +1 -1
- package/models/axis.d.ts +1 -1
- package/models/events.d.mts +11 -0
- package/models/events.d.ts +11 -0
- package/models/events.js +5 -0
- package/models/events.mjs +1 -0
- package/models/index.d.mts +1 -0
- package/models/index.d.ts +1 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.mts +3 -4
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +3 -4
- package/moduleAugmentation/keyboardActivation.d.mts +7 -0
- package/moduleAugmentation/keyboardActivation.d.ts +7 -0
- package/moduleAugmentation/keyboardActivation.js +8 -0
- package/moduleAugmentation/keyboardActivation.mjs +2 -0
- package/package.json +19 -5
|
@@ -68,13 +68,13 @@ export declare const selectorChartYScales: (args_0: import("../../corePlugins/us
|
|
|
68
68
|
*/
|
|
69
69
|
export declare const selectorChartXAxis: (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<{}> & {
|
|
70
70
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
71
|
-
}) => import("./computeAxisValue.js").ComputeResult<import("
|
|
71
|
+
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts/models").ChartsXAxisProps>;
|
|
72
72
|
export declare const selectorChartYAxis: (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<{}> & {
|
|
73
73
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
74
|
-
}) => import("./computeAxisValue.js").ComputeResult<import("
|
|
74
|
+
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts/models").ChartsYAxisProps>;
|
|
75
75
|
export declare const selectorChartAxis: (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<{}> & {
|
|
76
76
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
77
|
-
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("
|
|
77
|
+
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset"> & Required<Pick<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset">> & (({
|
|
78
78
|
scaleType: 'log';
|
|
79
79
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
80
80
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
@@ -105,14 +105,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
105
105
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
106
106
|
} | ({
|
|
107
107
|
scaleType: 'point';
|
|
108
|
-
ordinalTimeTicks?: import("
|
|
108
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
109
109
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
110
110
|
toString(): string;
|
|
111
111
|
}>;
|
|
112
112
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
113
113
|
} & import("../../../index.js").AxisGroups) | ({
|
|
114
114
|
scaleType: 'band';
|
|
115
|
-
ordinalTimeTicks?: import("
|
|
115
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
116
116
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
117
117
|
toString(): string;
|
|
118
118
|
}>;
|
|
@@ -141,7 +141,7 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
141
141
|
tickNumber: number;
|
|
142
142
|
triggerTooltip?: boolean;
|
|
143
143
|
isFullCircle?: boolean;
|
|
144
|
-
} & import("
|
|
144
|
+
} & import("@mui/x-charts/models").ChartsXAxisProps & {
|
|
145
145
|
position?: "bottom" | "none" | "top" | undefined;
|
|
146
146
|
height?: number | "auto" | undefined;
|
|
147
147
|
width?: undefined;
|
|
@@ -150,14 +150,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
150
150
|
};
|
|
151
151
|
export declare const selectorChartRawAxis: (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> & {
|
|
152
152
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
153
|
-
}, axisId: AxisId) => DefaultedAxis<"band", any, import("
|
|
153
|
+
}, axisId: AxisId) => DefaultedAxis<"band", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"linear", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"log", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"point", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"pow", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"sqrt", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"symlog", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"time", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"utc", any, import("@mui/x-charts/models").ChartsXAxisProps> | ({
|
|
154
154
|
offset?: number;
|
|
155
155
|
} & {
|
|
156
156
|
id: AxisId;
|
|
157
157
|
data?: readonly any[] | undefined;
|
|
158
158
|
dataKey?: string;
|
|
159
159
|
valueGetter?: ((item: import("../../../index.js").DatasetElementType<unknown>) => any) | undefined;
|
|
160
|
-
valueFormatter?: (<TScaleName extends keyof import("../../../index.js").AxisScaleConfig>(value: any, context: import("
|
|
160
|
+
valueFormatter?: (<TScaleName extends keyof import("../../../index.js").AxisScaleConfig>(value: any, context: import("@mui/x-charts/models").AxisValueFormatterContext<TScaleName>) => string) | undefined;
|
|
161
161
|
hideTooltip?: boolean;
|
|
162
162
|
reverse?: boolean;
|
|
163
163
|
domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => {
|
|
@@ -166,7 +166,7 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
166
166
|
});
|
|
167
167
|
domainSeries?: 'all' | 'visible';
|
|
168
168
|
ignoreTooltip?: boolean;
|
|
169
|
-
} & Omit<Partial<import("
|
|
169
|
+
} & Omit<Partial<import("@mui/x-charts/models").ChartsYAxisProps>, "axisId"> & Partial<Omit<{
|
|
170
170
|
scaleType: 'log';
|
|
171
171
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
172
172
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
@@ -197,14 +197,14 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
197
197
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
198
198
|
} | ({
|
|
199
199
|
scaleType: 'point';
|
|
200
|
-
ordinalTimeTicks?: import("
|
|
200
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
201
201
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
202
202
|
toString(): string;
|
|
203
203
|
}>;
|
|
204
204
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
205
205
|
} & import("../../../index.js").AxisGroups) | ({
|
|
206
206
|
scaleType: 'band';
|
|
207
|
-
ordinalTimeTicks?: import("
|
|
207
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
208
208
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
209
209
|
toString(): string;
|
|
210
210
|
}>;
|
|
@@ -70,14 +70,14 @@ export declare const selectorChartsHighlightXAxis: (args_0: import("../../corePl
|
|
|
70
70
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
71
71
|
} | ({
|
|
72
72
|
scaleType: 'point';
|
|
73
|
-
ordinalTimeTicks?: import("
|
|
73
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
74
74
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
75
75
|
toString(): string;
|
|
76
76
|
}>;
|
|
77
77
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
78
78
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
79
79
|
scaleType: 'band';
|
|
80
|
-
ordinalTimeTicks?: import("
|
|
80
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
81
81
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
82
82
|
toString(): string;
|
|
83
83
|
}>;
|
|
@@ -148,14 +148,14 @@ export declare const selectorChartsHighlightYAxis: (args_0: import("../../corePl
|
|
|
148
148
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
149
149
|
} | ({
|
|
150
150
|
scaleType: 'point';
|
|
151
|
-
ordinalTimeTicks?: import("
|
|
151
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
152
152
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
153
153
|
toString(): string;
|
|
154
154
|
}>;
|
|
155
155
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
156
156
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
157
157
|
scaleType: 'band';
|
|
158
|
-
ordinalTimeTicks?: import("
|
|
158
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
159
159
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
160
160
|
toString(): string;
|
|
161
161
|
}>;
|
|
@@ -70,14 +70,14 @@ export declare const selectorChartsHighlightXAxis: (args_0: import("../../corePl
|
|
|
70
70
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
71
71
|
} | ({
|
|
72
72
|
scaleType: 'point';
|
|
73
|
-
ordinalTimeTicks?: import("
|
|
73
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
74
74
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
75
75
|
toString(): string;
|
|
76
76
|
}>;
|
|
77
77
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
78
78
|
} & import("../../../index.js").AxisGroups) | ({
|
|
79
79
|
scaleType: 'band';
|
|
80
|
-
ordinalTimeTicks?: import("
|
|
80
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
81
81
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
82
82
|
toString(): string;
|
|
83
83
|
}>;
|
|
@@ -148,14 +148,14 @@ export declare const selectorChartsHighlightYAxis: (args_0: import("../../corePl
|
|
|
148
148
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
149
149
|
} | ({
|
|
150
150
|
scaleType: 'point';
|
|
151
|
-
ordinalTimeTicks?: import("
|
|
151
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
152
152
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
153
153
|
toString(): string;
|
|
154
154
|
}>;
|
|
155
155
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
156
156
|
} & import("../../../index.js").AxisGroups) | ({
|
|
157
157
|
scaleType: 'band';
|
|
158
|
-
ordinalTimeTicks?: import("
|
|
158
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
159
159
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
160
160
|
toString(): string;
|
|
161
161
|
}>;
|
|
@@ -219,6 +219,25 @@ const useChartClosestPoint = ({
|
|
|
219
219
|
pressEndHandler.cleanup();
|
|
220
220
|
};
|
|
221
221
|
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
222
|
+
React.useEffect(() => {
|
|
223
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
return instance.registerItemActivationHandler({
|
|
227
|
+
type: 'scatter'
|
|
228
|
+
}, (event, item) => {
|
|
229
|
+
if (item.type !== 'scatter') {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
234
|
+
onItemClick(event, {
|
|
235
|
+
type: 'scatter',
|
|
236
|
+
seriesId: item.seriesId,
|
|
237
|
+
dataIndex: item.dataIndex
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
}, [instance, onItemClick]);
|
|
222
241
|
|
|
223
242
|
// Instance implementation
|
|
224
243
|
const enableVoronoiCallback = (0, _useEventCallback.default)(() => {
|
|
@@ -212,6 +212,25 @@ export const useChartClosestPoint = ({
|
|
|
212
212
|
pressEndHandler.cleanup();
|
|
213
213
|
};
|
|
214
214
|
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
215
|
+
React.useEffect(() => {
|
|
216
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
return instance.registerItemActivationHandler({
|
|
220
|
+
type: 'scatter'
|
|
221
|
+
}, (event, item) => {
|
|
222
|
+
if (item.type !== 'scatter') {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
227
|
+
onItemClick(event, {
|
|
228
|
+
type: 'scatter',
|
|
229
|
+
seriesId: item.seriesId,
|
|
230
|
+
dataIndex: item.dataIndex
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}, [instance, onItemClick]);
|
|
215
234
|
|
|
216
235
|
// Instance implementation
|
|
217
236
|
const enableVoronoiCallback = useEventCallback(() => {
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts
CHANGED
|
@@ -7,6 +7,8 @@ import type { UseChartHighlightSignature } from "../useChartHighlight/index.mjs"
|
|
|
7
7
|
import type { UseChartInteractionSignature } from "../useChartInteraction/index.mjs";
|
|
8
8
|
import type { UseChartTooltipSignature } from "../useChartTooltip/index.mjs";
|
|
9
9
|
import type { UseChartZAxisSignature } from "../useChartZAxis/index.mjs";
|
|
10
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.mjs";
|
|
11
|
+
import type { ChartsActivationEvent } from "../../../../models/events.mjs";
|
|
10
12
|
export interface UseChartVoronoiInstance {
|
|
11
13
|
/**
|
|
12
14
|
* Enable the voronoi computation.
|
|
@@ -40,10 +42,10 @@ export interface UseChartVoronoiParameters {
|
|
|
40
42
|
/**
|
|
41
43
|
* Callback fired when clicking close to an item.
|
|
42
44
|
* This is only available for scatter plot for now.
|
|
43
|
-
* @param {
|
|
45
|
+
* @param {ChartsActivationEvent} event Event caught at the svg level
|
|
44
46
|
* @param {ScatterItemIdentifier} scatterItemIdentifier Identify which item got clicked
|
|
45
47
|
*/
|
|
46
|
-
onItemClick?: (event:
|
|
48
|
+
onItemClick?: (event: ChartsActivationEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
47
49
|
}
|
|
48
50
|
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
49
51
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -52,5 +54,5 @@ export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = C
|
|
|
52
54
|
params: UseChartVoronoiParameters;
|
|
53
55
|
defaultizedParams: UseChartVoronoiDefaultizedParameters;
|
|
54
56
|
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
55
|
-
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature];
|
|
57
|
+
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature, UseChartKeyboardNavigationSignature];
|
|
56
58
|
}>;
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { UseChartHighlightSignature } from "../useChartHighlight/index.js";
|
|
|
7
7
|
import type { UseChartInteractionSignature } from "../useChartInteraction/index.js";
|
|
8
8
|
import type { UseChartTooltipSignature } from "../useChartTooltip/index.js";
|
|
9
9
|
import type { UseChartZAxisSignature } from "../useChartZAxis/index.js";
|
|
10
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.js";
|
|
11
|
+
import type { ChartsActivationEvent } from "../../../../models/events.js";
|
|
10
12
|
export interface UseChartVoronoiInstance {
|
|
11
13
|
/**
|
|
12
14
|
* Enable the voronoi computation.
|
|
@@ -40,10 +42,10 @@ export interface UseChartVoronoiParameters {
|
|
|
40
42
|
/**
|
|
41
43
|
* Callback fired when clicking close to an item.
|
|
42
44
|
* This is only available for scatter plot for now.
|
|
43
|
-
* @param {
|
|
45
|
+
* @param {ChartsActivationEvent} event Event caught at the svg level
|
|
44
46
|
* @param {ScatterItemIdentifier} scatterItemIdentifier Identify which item got clicked
|
|
45
47
|
*/
|
|
46
|
-
onItemClick?: (event:
|
|
48
|
+
onItemClick?: (event: ChartsActivationEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
47
49
|
}
|
|
48
50
|
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
49
51
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -52,5 +54,5 @@ export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = C
|
|
|
52
54
|
params: UseChartVoronoiParameters;
|
|
53
55
|
defaultizedParams: UseChartVoronoiDefaultizedParameters;
|
|
54
56
|
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
55
|
-
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature];
|
|
57
|
+
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature, UseChartKeyboardNavigationSignature];
|
|
56
58
|
}>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.useChartItemClick = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
10
|
var _getChartPoint = require("../../../getChartPoint");
|
|
9
11
|
const useChartItemClick = ({
|
|
10
12
|
params,
|
|
@@ -14,6 +16,19 @@ const useChartItemClick = ({
|
|
|
14
16
|
const {
|
|
15
17
|
onItemClick
|
|
16
18
|
} = params;
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return instance.registerItemActivationHandler({}, (event, item) => {
|
|
24
|
+
const seriesTypeConfig = store.state.seriesConfig.config[item.type];
|
|
25
|
+
// @ts-ignore The type inference for store.state does not support generic yet
|
|
26
|
+
const itemWithData = seriesTypeConfig?.getItemWithData?.(store.state, item);
|
|
27
|
+
|
|
28
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
29
|
+
onItemClick(event, itemWithData ?? item);
|
|
30
|
+
});
|
|
31
|
+
}, [instance, onItemClick, store]);
|
|
17
32
|
if (!onItemClick) {
|
|
18
33
|
return {
|
|
19
34
|
instance: {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { getChartPoint } from "../../../getChartPoint.mjs";
|
|
4
5
|
export const useChartItemClick = ({
|
|
5
6
|
params,
|
|
@@ -9,6 +10,19 @@ export const useChartItemClick = ({
|
|
|
9
10
|
const {
|
|
10
11
|
onItemClick
|
|
11
12
|
} = params;
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return instance.registerItemActivationHandler({}, (event, item) => {
|
|
18
|
+
const seriesTypeConfig = store.state.seriesConfig.config[item.type];
|
|
19
|
+
// @ts-ignore The type inference for store.state does not support generic yet
|
|
20
|
+
const itemWithData = seriesTypeConfig?.getItemWithData?.(store.state, item);
|
|
21
|
+
|
|
22
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
23
|
+
onItemClick(event, itemWithData ?? item);
|
|
24
|
+
});
|
|
25
|
+
}, [instance, onItemClick, store]);
|
|
12
26
|
if (!onItemClick) {
|
|
13
27
|
return {
|
|
14
28
|
instance: {}
|
|
@@ -2,14 +2,16 @@ import type { ChartPluginSignature } from "../../models/index.mjs";
|
|
|
2
2
|
import type { ChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
3
3
|
import type { SeriesItemIdentifierWithType } from "../../../../models/seriesType/index.mjs";
|
|
4
4
|
import type { ChartSeriesTypeRequiredPlugins } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
5
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.mjs";
|
|
6
|
+
import type { ChartsActivationEvent } from "../../../../models/events.mjs";
|
|
5
7
|
export interface UseChartItemClickParameters<SeriesType extends ChartSeriesType = ChartSeriesType> {
|
|
6
8
|
/**
|
|
7
9
|
* The callback fired when an item is clicked.
|
|
8
10
|
*
|
|
9
|
-
* @param {
|
|
11
|
+
* @param {ChartsActivationEvent<HTMLDivElement>} event The click event.
|
|
10
12
|
* @param {SeriesItemIdentifierWithType<SeriesType>} item The clicked item.
|
|
11
13
|
*/
|
|
12
|
-
onItemClick?: (event:
|
|
14
|
+
onItemClick?: (event: ChartsActivationEvent<HTMLDivElement>, item: SeriesItemIdentifierWithType<SeriesType>) => void;
|
|
13
15
|
}
|
|
14
16
|
export interface UseChartItemClickInstance {
|
|
15
17
|
handleClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
@@ -20,4 +22,5 @@ export type UseChartItemClickSignature<SeriesType extends ChartSeriesType = Char
|
|
|
20
22
|
defaultizedParams: UseChartItemClickParameters<SeriesType>;
|
|
21
23
|
instance: UseChartItemClickInstance;
|
|
22
24
|
dependencies: ChartSeriesTypeRequiredPlugins<SeriesType>;
|
|
25
|
+
optionalDependencies: [UseChartKeyboardNavigationSignature];
|
|
23
26
|
}>;
|
|
@@ -2,14 +2,16 @@ import type { ChartPluginSignature } from "../../models/index.js";
|
|
|
2
2
|
import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
3
3
|
import type { SeriesItemIdentifierWithType } from "../../../../models/seriesType/index.js";
|
|
4
4
|
import type { ChartSeriesTypeRequiredPlugins } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
5
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.js";
|
|
6
|
+
import type { ChartsActivationEvent } from "../../../../models/events.js";
|
|
5
7
|
export interface UseChartItemClickParameters<SeriesType extends ChartSeriesType = ChartSeriesType> {
|
|
6
8
|
/**
|
|
7
9
|
* The callback fired when an item is clicked.
|
|
8
10
|
*
|
|
9
|
-
* @param {
|
|
11
|
+
* @param {ChartsActivationEvent<HTMLDivElement>} event The click event.
|
|
10
12
|
* @param {SeriesItemIdentifierWithType<SeriesType>} item The clicked item.
|
|
11
13
|
*/
|
|
12
|
-
onItemClick?: (event:
|
|
14
|
+
onItemClick?: (event: ChartsActivationEvent<HTMLDivElement>, item: SeriesItemIdentifierWithType<SeriesType>) => void;
|
|
13
15
|
}
|
|
14
16
|
export interface UseChartItemClickInstance {
|
|
15
17
|
handleClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
@@ -20,4 +22,5 @@ export type UseChartItemClickSignature<SeriesType extends ChartSeriesType = Char
|
|
|
20
22
|
defaultizedParams: UseChartItemClickParameters<SeriesType>;
|
|
21
23
|
instance: UseChartItemClickInstance;
|
|
22
24
|
dependencies: ChartSeriesTypeRequiredPlugins<SeriesType>;
|
|
25
|
+
optionalDependencies: [UseChartKeyboardNavigationSignature];
|
|
23
26
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useChartKeyboardNavigation } from "./useChartKeyboardNavigation.mjs";
|
|
2
2
|
export * from "./useChartKeyboardNavigation.selectors.mjs";
|
|
3
|
-
export type { UseChartKeyboardNavigationSignature } from "./useChartKeyboardNavigation.types.mjs";
|
|
3
|
+
export type { UseChartKeyboardNavigationSignature, ItemActivationHandler, ItemActivationScope } from "./useChartKeyboardNavigation.types.mjs";
|
|
4
|
+
export { isItemActivationKey } from "./itemActivation.mjs";
|
|
4
5
|
export type * from "./keyboardFocusHandler.types.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useChartKeyboardNavigation } from "./useChartKeyboardNavigation.js";
|
|
2
2
|
export * from "./useChartKeyboardNavigation.selectors.js";
|
|
3
|
-
export type { UseChartKeyboardNavigationSignature } from "./useChartKeyboardNavigation.types.js";
|
|
3
|
+
export type { UseChartKeyboardNavigationSignature, ItemActivationHandler, ItemActivationScope } from "./useChartKeyboardNavigation.types.js";
|
|
4
|
+
export { isItemActivationKey } from "./itemActivation.js";
|
|
4
5
|
export type * from "./keyboardFocusHandler.types.js";
|
|
@@ -4,8 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
useChartKeyboardNavigation: true
|
|
7
|
+
useChartKeyboardNavigation: true,
|
|
8
|
+
isItemActivationKey: true
|
|
8
9
|
};
|
|
10
|
+
Object.defineProperty(exports, "isItemActivationKey", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _itemActivation.isItemActivationKey;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
9
16
|
Object.defineProperty(exports, "useChartKeyboardNavigation", {
|
|
10
17
|
enumerable: true,
|
|
11
18
|
get: function () {
|
|
@@ -24,4 +31,5 @@ Object.keys(_useChartKeyboardNavigation2).forEach(function (key) {
|
|
|
24
31
|
return _useChartKeyboardNavigation2[key];
|
|
25
32
|
}
|
|
26
33
|
});
|
|
27
|
-
});
|
|
34
|
+
});
|
|
35
|
+
var _itemActivation = require("./itemActivation");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FocusedItemIdentifier } from "../../../../models/seriesType/index.mjs";
|
|
2
|
+
import type { ChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
3
|
+
import type { ItemActivationHandler, ItemActivationScope } from "./useChartKeyboardNavigation.types.mjs";
|
|
4
|
+
export type ItemActivationRegistration = {
|
|
5
|
+
scope: ItemActivationScope;
|
|
6
|
+
handler: ItemActivationHandler;
|
|
7
|
+
};
|
|
8
|
+
export declare function isItemActivationKey(event: KeyboardEvent): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the handler matching the item with the most specific scope, the highest priority
|
|
11
|
+
* breaking ties, or `null` when none matches.
|
|
12
|
+
*/
|
|
13
|
+
export declare function findItemActivationHandler(registrations: Iterable<ItemActivationRegistration>, item: FocusedItemIdentifier<ChartSeriesType>): ItemActivationHandler | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FocusedItemIdentifier } from "../../../../models/seriesType/index.js";
|
|
2
|
+
import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
3
|
+
import type { ItemActivationHandler, ItemActivationScope } from "./useChartKeyboardNavigation.types.js";
|
|
4
|
+
export type ItemActivationRegistration = {
|
|
5
|
+
scope: ItemActivationScope;
|
|
6
|
+
handler: ItemActivationHandler;
|
|
7
|
+
};
|
|
8
|
+
export declare function isItemActivationKey(event: KeyboardEvent): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the handler matching the item with the most specific scope, the highest priority
|
|
11
|
+
* breaking ties, or `null` when none matches.
|
|
12
|
+
*/
|
|
13
|
+
export declare function findItemActivationHandler(registrations: Iterable<ItemActivationRegistration>, item: FocusedItemIdentifier<ChartSeriesType>): ItemActivationHandler | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findItemActivationHandler = findItemActivationHandler;
|
|
7
|
+
exports.isItemActivationKey = isItemActivationKey;
|
|
8
|
+
function isItemActivationKey(event) {
|
|
9
|
+
return event.key === 'Enter' || event.key === ' ';
|
|
10
|
+
}
|
|
11
|
+
function getScopeSpecificity(scope, item) {
|
|
12
|
+
if (scope.type !== undefined && scope.type !== item.type) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (scope.seriesId !== undefined && (!('seriesId' in item) || scope.seriesId !== item.seriesId)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (scope.type === undefined ? 0 : 1) + (scope.seriesId === undefined ? 0 : 1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns the handler matching the item with the most specific scope, the highest priority
|
|
23
|
+
* breaking ties, or `null` when none matches.
|
|
24
|
+
*/
|
|
25
|
+
function findItemActivationHandler(registrations, item) {
|
|
26
|
+
let bestHandler = null;
|
|
27
|
+
let bestSpecificity = -1;
|
|
28
|
+
let bestPriority = -1;
|
|
29
|
+
for (const registration of registrations) {
|
|
30
|
+
const specificity = getScopeSpecificity(registration.scope, item);
|
|
31
|
+
const priority = registration.scope.priority ?? 0;
|
|
32
|
+
if (specificity !== null && (registration.scope.canActivate === undefined || registration.scope.canActivate(item)) && (specificity > bestSpecificity || specificity === bestSpecificity && priority > bestPriority)) {
|
|
33
|
+
bestHandler = registration.handler;
|
|
34
|
+
bestSpecificity = specificity;
|
|
35
|
+
bestPriority = priority;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return bestHandler;
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function isItemActivationKey(event) {
|
|
2
|
+
return event.key === 'Enter' || event.key === ' ';
|
|
3
|
+
}
|
|
4
|
+
function getScopeSpecificity(scope, item) {
|
|
5
|
+
if (scope.type !== undefined && scope.type !== item.type) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
if (scope.seriesId !== undefined && (!('seriesId' in item) || scope.seriesId !== item.seriesId)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (scope.type === undefined ? 0 : 1) + (scope.seriesId === undefined ? 0 : 1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the handler matching the item with the most specific scope, the highest priority
|
|
16
|
+
* breaking ties, or `null` when none matches.
|
|
17
|
+
*/
|
|
18
|
+
export function findItemActivationHandler(registrations, item) {
|
|
19
|
+
let bestHandler = null;
|
|
20
|
+
let bestSpecificity = -1;
|
|
21
|
+
let bestPriority = -1;
|
|
22
|
+
for (const registration of registrations) {
|
|
23
|
+
const specificity = getScopeSpecificity(registration.scope, item);
|
|
24
|
+
const priority = registration.scope.priority ?? 0;
|
|
25
|
+
if (specificity !== null && (registration.scope.canActivate === undefined || registration.scope.canActivate(item)) && (specificity > bestSpecificity || specificity === bestSpecificity && priority > bestPriority)) {
|
|
26
|
+
bestHandler = registration.handler;
|
|
27
|
+
bestSpecificity = specificity;
|
|
28
|
+
bestPriority = priority;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return bestHandler;
|
|
32
|
+
}
|