@mui/x-charts 8.23.0 → 8.24.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 +39 -0
- package/BarChart/BarChart.plugins.d.ts +2 -1
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/BarChart/BarLabel/BarLabel.js +8 -3
- package/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/BarChart/BarPlot.d.ts +12 -2
- package/BarChart/BarPlot.js +29 -86
- package/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/BarChart/BatchBarPlot/BarGroup.js +142 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.js +140 -0
- package/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/BarChart/BatchBarPlot/index.js +12 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.js +53 -0
- package/BarChart/FocusedBar.js +5 -1
- package/BarChart/IndividualBarPlot.d.ts +21 -0
- package/BarChart/IndividualBarPlot.js +106 -0
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -1
- package/BarChart/seriesConfig/bar/legend.js +1 -0
- package/BarChart/seriesConfig/index.js +3 -1
- package/BarChart/types.d.ts +2 -0
- package/BarChart/useBarChartProps.d.ts +6 -2
- package/BarChart/useBarChartProps.js +4 -2
- package/BarChart/useBarPlotData.d.ts +1 -1
- package/BarChart/useBarPlotData.js +23 -4
- package/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/BarChart/useRegisterItemClickHandlers.js +72 -0
- package/CHANGELOG.md +111 -1
- package/ChartContainer/ChartContainer.js +34 -0
- package/ChartContainer/useChartContainerProps.js +6 -2
- package/ChartsLegend/ChartsLegend.js +2 -2
- package/ChartsLegend/legendContext.types.d.ts +12 -0
- package/ChartsLegend/onClickContextBuilder.js +2 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsReferenceLine/common.js +4 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +25 -21
- package/Gauge/GaugeContainer.js +4 -1
- package/LineChart/AnimatedLine.js +7 -3
- package/LineChart/AppearingMask.js +4 -1
- package/LineChart/CircleMarkElement.d.ts +5 -0
- package/LineChart/CircleMarkElement.js +13 -5
- package/LineChart/FocusedLineMark.js +5 -1
- package/LineChart/LineChart.js +30 -0
- package/LineChart/LineChart.plugins.d.ts +2 -1
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/LineElement.d.ts +4 -0
- package/LineChart/LineElement.js +7 -3
- package/LineChart/MarkElement.d.ts +5 -0
- package/LineChart/MarkElement.js +17 -10
- package/LineChart/markElementClasses.d.ts +0 -1
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/seriesConfig/legend.js +1 -0
- package/PieChart/FocusedPieArc.js +5 -2
- package/PieChart/PieArcLabel.d.ts +2 -0
- package/PieChart/PieArcLabel.js +5 -2
- package/PieChart/PieChart.js +35 -5
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/seriesConfig/index.js +3 -1
- package/PieChart/seriesConfig/legend.js +6 -3
- package/RadarChart/RadarChart.js +30 -0
- package/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/RadarChart/RadarChart.plugins.js +2 -1
- package/RadarChart/seriesConfig/index.js +3 -1
- package/RadarChart/seriesConfig/legend.js +1 -0
- package/ScatterChart/BatchScatter.js +8 -14
- package/ScatterChart/ScatterChart.js +30 -0
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/seriesConfig/index.js +3 -1
- package/ScatterChart/seriesConfig/legend.js +1 -0
- package/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/BarChart/BarChart.js +39 -0
- package/esm/BarChart/BarChart.plugins.d.ts +2 -1
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabel.js +8 -3
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/esm/BarChart/BarPlot.d.ts +12 -2
- package/esm/BarChart/BarPlot.js +29 -86
- package/esm/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/esm/BarChart/BatchBarPlot/BarGroup.js +134 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.js +133 -0
- package/esm/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/esm/BarChart/BatchBarPlot/index.js +1 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.js +46 -0
- package/esm/BarChart/FocusedBar.js +5 -1
- package/esm/BarChart/IndividualBarPlot.d.ts +21 -0
- package/esm/BarChart/IndividualBarPlot.js +98 -0
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -1
- package/esm/BarChart/seriesConfig/bar/legend.js +1 -0
- package/esm/BarChart/seriesConfig/index.js +3 -1
- package/esm/BarChart/types.d.ts +2 -0
- package/esm/BarChart/useBarChartProps.d.ts +6 -2
- package/esm/BarChart/useBarChartProps.js +4 -3
- package/esm/BarChart/useBarPlotData.d.ts +1 -1
- package/esm/BarChart/useBarPlotData.js +20 -1
- package/esm/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/esm/BarChart/useRegisterItemClickHandlers.js +67 -0
- package/esm/ChartContainer/ChartContainer.js +34 -0
- package/esm/ChartContainer/useChartContainerProps.js +6 -2
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/legendContext.types.d.ts +12 -0
- package/esm/ChartsLegend/onClickContextBuilder.js +2 -1
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/esm/ChartsReferenceLine/common.d.ts +1 -1
- package/esm/ChartsReferenceLine/common.js +4 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +26 -22
- package/esm/Gauge/GaugeContainer.js +4 -1
- package/esm/LineChart/AnimatedLine.js +7 -3
- package/esm/LineChart/AppearingMask.js +4 -1
- package/esm/LineChart/CircleMarkElement.d.ts +5 -0
- package/esm/LineChart/CircleMarkElement.js +13 -5
- package/esm/LineChart/FocusedLineMark.js +5 -1
- package/esm/LineChart/LineChart.js +30 -0
- package/esm/LineChart/LineChart.plugins.d.ts +2 -1
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/LineElement.d.ts +4 -0
- package/esm/LineChart/LineElement.js +7 -3
- package/esm/LineChart/MarkElement.d.ts +5 -0
- package/esm/LineChart/MarkElement.js +17 -10
- package/esm/LineChart/markElementClasses.d.ts +0 -1
- package/esm/LineChart/seriesConfig/index.js +3 -1
- package/esm/LineChart/seriesConfig/legend.js +1 -0
- package/esm/PieChart/FocusedPieArc.js +4 -1
- package/esm/PieChart/PieArcLabel.d.ts +2 -0
- package/esm/PieChart/PieArcLabel.js +5 -2
- package/esm/PieChart/PieChart.js +35 -5
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/seriesConfig/index.js +3 -1
- package/esm/PieChart/seriesConfig/legend.js +6 -3
- package/esm/RadarChart/RadarChart.js +30 -0
- package/esm/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/esm/RadarChart/RadarChart.plugins.js +2 -1
- package/esm/RadarChart/seriesConfig/index.js +3 -1
- package/esm/RadarChart/seriesConfig/legend.js +1 -0
- package/esm/ScatterChart/BatchScatter.js +5 -11
- package/esm/ScatterChart/ScatterChart.js +30 -0
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/esm/ScatterChart/ScatterChart.plugins.js +2 -1
- package/esm/ScatterChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChart/seriesConfig/legend.js +1 -0
- package/esm/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/index.js +1 -1
- package/esm/internals/appendAtKey.d.ts +8 -0
- package/esm/internals/appendAtKey.js +17 -0
- package/esm/internals/commonNextFocusItem.js +12 -8
- package/esm/internals/getBarDimensions.d.ts +1 -2
- package/esm/internals/identifierSerializer.d.ts +9 -0
- package/esm/internals/identifierSerializer.js +6 -0
- package/esm/internals/index.d.ts +6 -2
- package/esm/internals/index.js +6 -2
- package/esm/internals/invertScale.d.ts +6 -2
- package/esm/internals/invertScale.js +9 -1
- package/esm/internals/plugins/allPlugins.d.ts +4 -3
- package/esm/internals/plugins/allPlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +18 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +74 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +83 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +7 -34
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +9 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +10 -32
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +78 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +19 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +11 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/index.js +2 -1
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +7 -0
- package/esm/models/axis.d.ts +5 -4
- package/esm/models/featureFlags.d.ts +1 -0
- package/esm/models/featureFlags.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.js +1 -0
- package/index.js +1 -1
- package/internals/appendAtKey.d.ts +8 -0
- package/internals/appendAtKey.js +23 -0
- package/internals/commonNextFocusItem.js +12 -8
- package/internals/getBarDimensions.d.ts +1 -2
- package/internals/identifierSerializer.d.ts +9 -0
- package/internals/identifierSerializer.js +16 -0
- package/internals/index.d.ts +6 -2
- package/internals/index.js +51 -7
- package/internals/invertScale.d.ts +6 -2
- package/internals/invertScale.js +10 -1
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +25 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +12 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +6 -34
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +15 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +9 -32
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +39 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +12 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +85 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +25 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +18 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.js +5 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/index.js +11 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +7 -0
- package/models/axis.d.ts +5 -4
- package/models/featureFlags.d.ts +1 -0
- package/models/featureFlags.js +5 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.js +5 -0
- package/package.json +13 -3
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type ChartPluginSignature } from "../../models/index.js";
|
|
2
|
+
import { type UseChartSeriesSignature } from "../../corePlugins/useChartSeries/index.js";
|
|
3
|
+
import { type SeriesItemIdentifier } from "../../../../models/index.js";
|
|
4
|
+
import { type ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
5
|
+
export type VisibilityIdentifier<T extends ChartSeriesType = ChartSeriesType> = Partial<SeriesItemIdentifier<T>> & (SeriesItemIdentifier<T> extends {
|
|
6
|
+
subType?: infer U;
|
|
7
|
+
} ? {
|
|
8
|
+
type: T;
|
|
9
|
+
subType: U;
|
|
10
|
+
} : {
|
|
11
|
+
type: T;
|
|
12
|
+
});
|
|
13
|
+
export type VisibilityMap = Map<string, VisibilityIdentifier>;
|
|
14
|
+
export type IsItemVisibleFunction = {
|
|
15
|
+
/**
|
|
16
|
+
* Function to check if an item is visible based on its identifier.
|
|
17
|
+
*
|
|
18
|
+
* @param {VisibilityIdentifier} identifier The identifier of the item to check.
|
|
19
|
+
* @returns {boolean} Whether the item is visible.
|
|
20
|
+
*/
|
|
21
|
+
(identifier: VisibilityIdentifier): boolean;
|
|
22
|
+
};
|
|
23
|
+
export interface UseChartVisibilityManagerInstance<T extends ChartSeriesType> {
|
|
24
|
+
/**
|
|
25
|
+
* Hide an item by its identifier.
|
|
26
|
+
*
|
|
27
|
+
* @param {VisibilityIdentifier} identifier The identifier of the item to hide.
|
|
28
|
+
*/
|
|
29
|
+
hideItem(identifier: VisibilityIdentifier<T>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Show an item by its identifier.
|
|
32
|
+
*
|
|
33
|
+
* @param {VisibilityIdentifier} identifier The identifier of the item to show.
|
|
34
|
+
*/
|
|
35
|
+
showItem(identifier: VisibilityIdentifier<T>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Toggle the visibility of an item by its identifier.
|
|
38
|
+
*
|
|
39
|
+
* @param {VisibilityIdentifier} identifier The identifier of the item to toggle.
|
|
40
|
+
*/
|
|
41
|
+
toggleItemVisibility(identifier: VisibilityIdentifier<T>): void;
|
|
42
|
+
}
|
|
43
|
+
export interface UseChartVisibilityManagerParameters<T extends ChartSeriesType> {
|
|
44
|
+
/**
|
|
45
|
+
* Callback fired when any hidden identifiers change.
|
|
46
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
47
|
+
*/
|
|
48
|
+
onHiddenItemsChange?: (hiddenItems: VisibilityIdentifier<T>[]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* List of hidden series and/or items.
|
|
51
|
+
*
|
|
52
|
+
* Different chart types use different keys.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* [
|
|
57
|
+
* {
|
|
58
|
+
* type: 'pie',
|
|
59
|
+
* seriesId: 'series-1',
|
|
60
|
+
* dataIndex: 3,
|
|
61
|
+
* },
|
|
62
|
+
* {
|
|
63
|
+
* type: 'line',
|
|
64
|
+
* seriesId: 'series-2',
|
|
65
|
+
* }
|
|
66
|
+
* ]
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
hiddenItems?: VisibilityIdentifier<T>[];
|
|
70
|
+
}
|
|
71
|
+
export type UseChartVisibilityManagerDefaultizedParameters<T extends ChartSeriesType> = UseChartVisibilityManagerParameters<T>;
|
|
72
|
+
export interface UseChartVisibilityManagerState {
|
|
73
|
+
visibilityManager: {
|
|
74
|
+
/**
|
|
75
|
+
* Map of hidden identifiers by their serialized form.
|
|
76
|
+
*/
|
|
77
|
+
visibilityMap: VisibilityMap;
|
|
78
|
+
/**
|
|
79
|
+
* Internal information to know if the user controls the state or not.
|
|
80
|
+
*/
|
|
81
|
+
isControlled: boolean;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export type UseChartVisibilityManagerSignature<T extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
85
|
+
instance: UseChartVisibilityManagerInstance<T>;
|
|
86
|
+
state: UseChartVisibilityManagerState;
|
|
87
|
+
params: UseChartVisibilityManagerParameters<T>;
|
|
88
|
+
defaultizedParams: UseChartVisibilityManagerDefaultizedParameters<T>;
|
|
89
|
+
dependencies: [UseChartSeriesSignature];
|
|
90
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
|
+
import type { ChartSeriesConfig } from "../../models/index.js";
|
|
3
|
+
import type { VisibilityIdentifier, VisibilityMap } from "./useChartVisibilityManager.types.js";
|
|
4
|
+
export declare const visibilityParamToMap: (hiddenItems: VisibilityIdentifier[] | undefined, seriesConfig: ChartSeriesConfig<ChartSeriesType>) => VisibilityMap;
|
package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { serializeIdentifier } from "../../corePlugins/useChartSeries/serializeIdentifier.js";
|
|
2
|
+
export const visibilityParamToMap = (hiddenItems, seriesConfig) => {
|
|
3
|
+
const visibilityMap = new Map();
|
|
4
|
+
if (hiddenItems) {
|
|
5
|
+
hiddenItems.forEach(identifier => {
|
|
6
|
+
const uniqueId = serializeIdentifier(seriesConfig, identifier);
|
|
7
|
+
visibilityMap.set(uniqueId, identifier);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return visibilityMap;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,4 +7,5 @@ export * from "./seriesLayout.types.js";
|
|
|
7
7
|
export * from "./tooltipGetter.types.js";
|
|
8
8
|
export * from "./tooltipItemPositionGetter.types.js";
|
|
9
9
|
export * from "./legendGetter.types.js";
|
|
10
|
-
export * from "./getSeriesWithDefaultValues.types.js";
|
|
10
|
+
export * from "./getSeriesWithDefaultValues.types.js";
|
|
11
|
+
export * from "./identifierSerializer.types.js";
|
|
@@ -7,4 +7,5 @@ export * from "./seriesLayout.types.js";
|
|
|
7
7
|
export * from "./tooltipGetter.types.js";
|
|
8
8
|
export * from "./tooltipItemPositionGetter.types.js";
|
|
9
9
|
export * from "./legendGetter.types.js";
|
|
10
|
-
export * from "./getSeriesWithDefaultValues.types.js";
|
|
10
|
+
export * from "./getSeriesWithDefaultValues.types.js";
|
|
11
|
+
export * from "./identifierSerializer.types.js";
|
|
@@ -9,6 +9,7 @@ import { type GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.ty
|
|
|
9
9
|
import { type TooltipItemPositionGetter } from "./tooltipItemPositionGetter.types.js";
|
|
10
10
|
import { type SeriesLayoutGetter } from "./seriesLayout.types.js";
|
|
11
11
|
import { type KeyboardFocusHandler } from "../../featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
|
|
12
|
+
import { type IdentifierSerializer } from "./identifierSerializer.types.js";
|
|
12
13
|
export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
|
|
13
14
|
seriesProcessor: SeriesProcessor<TSeriesType>;
|
|
14
15
|
/**
|
|
@@ -21,6 +22,12 @@ export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
|
|
|
21
22
|
tooltipItemPositionGetter?: TooltipItemPositionGetter<TSeriesType>;
|
|
22
23
|
getSeriesWithDefaultValues: GetSeriesWithDefaultValues<TSeriesType>;
|
|
23
24
|
keyboardFocusHandler?: KeyboardFocusHandler<TSeriesType>;
|
|
25
|
+
/**
|
|
26
|
+
* A function to serialize the series item identifier into a unique string.
|
|
27
|
+
* @param {ChartsSeriesConfig[TSeriesType]['itemIdentifier']} identifier The series item identifier.
|
|
28
|
+
* @returns {string} A unique string representation of the identifier.
|
|
29
|
+
*/
|
|
30
|
+
identifierSerializer: IdentifierSerializer<TSeriesType>;
|
|
24
31
|
} & (TSeriesType extends CartesianChartSeriesType ? {
|
|
25
32
|
xExtremumGetter: CartesianExtremumGetter<TSeriesType>;
|
|
26
33
|
yExtremumGetter: CartesianExtremumGetter<TSeriesType>;
|
package/esm/models/axis.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ScaleBand, ScaleLinear, ScaleLogarithmic, ScaleOrdinal, ScalePoint, ScalePower, ScaleSequential, ScaleThreshold, ScaleTime, ScaleSymLog, NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
2
2
|
import { type SxProps } from '@mui/system/styleFunctionSx';
|
|
3
|
-
import { type MakeOptional, type MakeRequired } from '@mui/x-internals/types';
|
|
3
|
+
import { type HasProperty, type MakeOptional, type MakeRequired } from '@mui/x-internals/types';
|
|
4
4
|
import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
5
5
|
import { type ChartsAxisClasses } from "../ChartsAxis/axisClasses.js";
|
|
6
6
|
import type { TickParams } from "../hooks/useTicks.js";
|
|
7
7
|
import type { ChartsTextProps } from "../ChartsText/index.js";
|
|
8
8
|
import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
|
|
9
9
|
import type { OrdinalTimeTicks } from "./timeTicks.js";
|
|
10
|
+
import { type ChartsTypeFeatureFlags } from "./featureFlags.js";
|
|
10
11
|
export type AxisId = string | number;
|
|
11
12
|
export type D3Scale<Domain extends {
|
|
12
13
|
toString(): string;
|
|
@@ -133,7 +134,7 @@ type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends Chart
|
|
|
133
134
|
position?: 'top' | 'bottom' | 'none';
|
|
134
135
|
/**
|
|
135
136
|
* The height of the axis.
|
|
136
|
-
* @default
|
|
137
|
+
* @default 45 if an axis label is provided, 25 otherwise.
|
|
137
138
|
*/
|
|
138
139
|
height?: number;
|
|
139
140
|
} : AxisProps extends ChartsYAxisProps ? {
|
|
@@ -149,7 +150,7 @@ type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends Chart
|
|
|
149
150
|
position?: 'left' | 'right' | 'none';
|
|
150
151
|
/**
|
|
151
152
|
* The width of the axis.
|
|
152
|
-
* @default
|
|
153
|
+
* @default 65 if an axis label is provided, 45 otherwise.
|
|
153
154
|
*/
|
|
154
155
|
width?: number;
|
|
155
156
|
} : {
|
|
@@ -521,7 +522,7 @@ export interface ChartsAxisData {
|
|
|
521
522
|
/**
|
|
522
523
|
* The mapping of series ids to their value for this particular axis index.
|
|
523
524
|
*/
|
|
524
|
-
seriesValues: Record<string, number | null | undefined>;
|
|
525
|
+
seriesValues: Record<string, HasProperty<ChartsTypeFeatureFlags, 'seriesValueOverride'> extends true ? ChartsTypeFeatureFlags['seriesValuesOverride'] : number | null | undefined>;
|
|
525
526
|
}
|
|
526
527
|
export type CartesianDirection = 'x' | 'y';
|
|
527
528
|
export type PolarDirection = 'rotation' | 'radius';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export interface ChartsTypeFeatureFlags {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./seriesType/index.js";
|
|
2
2
|
export * from "./stacking.js";
|
|
3
3
|
export * from "./slots/index.js";
|
|
4
|
+
export * from "./featureFlags.js";
|
|
4
5
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisItemIdentifier, AxisValueFormatterContext } from "./axis.js";
|
|
5
6
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
|
6
7
|
export type { Position } from "./position.js";
|
package/esm/models/index.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { BarItemIdentifier } from "../models/index.js";
|
|
3
|
+
declare module '@mui/x-charts/BarChart' {
|
|
4
|
+
interface BarPlotProps {
|
|
5
|
+
/**
|
|
6
|
+
* Callback fired when a bar item is clicked.
|
|
7
|
+
* @param {MouseEvent | React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
8
|
+
* It is a native MouseEvent for `svg-batch` renderer and a React MouseEvent for `svg-single` renderer.
|
|
9
|
+
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
10
|
+
*/
|
|
11
|
+
onItemClick?(event: MouseEvent | React.MouseEvent<SVGElement, MouseEvent>, barItemIdentifier: BarItemIdentifier): void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a map of arrays, appends a value to the array at the given key.
|
|
3
|
+
* If no array exists at that key, one is created and the value appended.
|
|
4
|
+
* @param map Map of arrays
|
|
5
|
+
* @param key Key to append the value at
|
|
6
|
+
* @param value Value to append
|
|
7
|
+
*/
|
|
8
|
+
export declare function appendAtKey<K, V>(map: Map<K, V[]>, key: K, value: V): V[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.appendAtKey = appendAtKey;
|
|
7
|
+
/**
|
|
8
|
+
* Given a map of arrays, appends a value to the array at the given key.
|
|
9
|
+
* If no array exists at that key, one is created and the value appended.
|
|
10
|
+
* @param map Map of arrays
|
|
11
|
+
* @param key Key to append the value at
|
|
12
|
+
* @param value Value to append
|
|
13
|
+
*/
|
|
14
|
+
function appendAtKey(map, key, value) {
|
|
15
|
+
let bucket = map.get(key);
|
|
16
|
+
if (!bucket) {
|
|
17
|
+
bucket = [value];
|
|
18
|
+
map.set(key, bucket);
|
|
19
|
+
} else {
|
|
20
|
+
bucket.push(value);
|
|
21
|
+
}
|
|
22
|
+
return bucket;
|
|
23
|
+
}
|
|
@@ -8,6 +8,7 @@ exports.createGetNextSeriesFocusedItem = createGetNextSeriesFocusedItem;
|
|
|
8
8
|
exports.createGetPreviousIndexFocusedItem = createGetPreviousIndexFocusedItem;
|
|
9
9
|
exports.createGetPreviousSeriesFocusedItem = createGetPreviousSeriesFocusedItem;
|
|
10
10
|
var _getPreviousNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries");
|
|
11
|
+
var _getMaxSeriesLength = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength");
|
|
11
12
|
var _useChartSeries = require("./plugins/corePlugins/useChartSeries");
|
|
12
13
|
var _getNextNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries");
|
|
13
14
|
var _seriesHasData = require("./seriesHasData");
|
|
@@ -24,11 +25,12 @@ function createGetNextIndexFocusedItem(compatibleSeriesTypes) {
|
|
|
24
25
|
type = nextSeries.type;
|
|
25
26
|
seriesId = nextSeries.seriesId;
|
|
26
27
|
}
|
|
27
|
-
const
|
|
28
|
+
const maxLength = (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
|
|
29
|
+
const dataIndex = Math.min(maxLength - 1, currentItem?.dataIndex == null ? 0 : currentItem.dataIndex + 1);
|
|
28
30
|
return {
|
|
29
31
|
type,
|
|
30
32
|
seriesId,
|
|
31
|
-
dataIndex
|
|
33
|
+
dataIndex
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
}
|
|
@@ -45,11 +47,12 @@ function createGetPreviousIndexFocusedItem(compatibleSeriesTypes) {
|
|
|
45
47
|
type = previousSeries.type;
|
|
46
48
|
seriesId = previousSeries.seriesId;
|
|
47
49
|
}
|
|
48
|
-
const
|
|
50
|
+
const maxLength = (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
|
|
51
|
+
const dataIndex = Math.max(0, currentItem?.dataIndex == null ? maxLength - 1 : currentItem.dataIndex - 1);
|
|
49
52
|
return {
|
|
50
53
|
type,
|
|
51
54
|
seriesId,
|
|
52
|
-
dataIndex
|
|
55
|
+
dataIndex
|
|
53
56
|
};
|
|
54
57
|
};
|
|
55
58
|
}
|
|
@@ -64,11 +67,11 @@ function createGetNextSeriesFocusedItem(compatibleSeriesTypes) {
|
|
|
64
67
|
}
|
|
65
68
|
type = nextSeries.type;
|
|
66
69
|
seriesId = nextSeries.seriesId;
|
|
67
|
-
const
|
|
70
|
+
const dataIndex = currentItem?.dataIndex == null ? 0 : currentItem.dataIndex;
|
|
68
71
|
return {
|
|
69
72
|
type,
|
|
70
73
|
seriesId,
|
|
71
|
-
dataIndex
|
|
74
|
+
dataIndex
|
|
72
75
|
};
|
|
73
76
|
};
|
|
74
77
|
}
|
|
@@ -83,11 +86,12 @@ function createGetPreviousSeriesFocusedItem(compatibleSeriesTypes) {
|
|
|
83
86
|
}
|
|
84
87
|
type = previousSeries.type;
|
|
85
88
|
seriesId = previousSeries.seriesId;
|
|
86
|
-
const
|
|
89
|
+
const data = processedSeries[type].series[seriesId].data;
|
|
90
|
+
const dataIndex = currentItem?.dataIndex == null ? data.length - 1 : currentItem.dataIndex;
|
|
87
91
|
return {
|
|
88
92
|
type,
|
|
89
93
|
seriesId,
|
|
90
|
-
dataIndex
|
|
94
|
+
dataIndex
|
|
91
95
|
};
|
|
92
96
|
};
|
|
93
97
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ComputedAxis } from "../models/axis.js";
|
|
1
|
+
import type { ChartsXAxisProps, ChartsYAxisProps, ComputedAxis, ScaleName } from "../models/axis.js";
|
|
3
2
|
import type { ChartSeriesDefaultized } from "../models/seriesType/config.js";
|
|
4
3
|
export declare function getBarDimensions(params: {
|
|
5
4
|
verticalLayout: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SeriesId } from "../models/index.js";
|
|
2
|
+
export declare const typeSerializer: (type: string) => string;
|
|
3
|
+
export declare const seriesIdSerializer: (id: SeriesId) => string;
|
|
4
|
+
export declare const dataIndexSerializer: (dataIndex?: number) => string;
|
|
5
|
+
export declare const identifierSerializerSeriesIdDataIndex: (identifier: {
|
|
6
|
+
type: string;
|
|
7
|
+
seriesId: SeriesId;
|
|
8
|
+
dataIndex?: number;
|
|
9
|
+
}) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.typeSerializer = exports.seriesIdSerializer = exports.identifierSerializerSeriesIdDataIndex = exports.dataIndexSerializer = void 0;
|
|
7
|
+
const typeSerializer = type => `Type(${type})`;
|
|
8
|
+
exports.typeSerializer = typeSerializer;
|
|
9
|
+
const seriesIdSerializer = id => `Series(${id})`;
|
|
10
|
+
exports.seriesIdSerializer = seriesIdSerializer;
|
|
11
|
+
const dataIndexSerializer = dataIndex => dataIndex === undefined ? '' : `Index(${dataIndex})`;
|
|
12
|
+
exports.dataIndexSerializer = dataIndexSerializer;
|
|
13
|
+
const identifierSerializerSeriesIdDataIndex = identifier => {
|
|
14
|
+
return `${typeSerializer(identifier.type)}${seriesIdSerializer(identifier.seriesId)}${dataIndexSerializer(identifier.dataIndex)}`;
|
|
15
|
+
};
|
|
16
|
+
exports.identifierSerializerSeriesIdDataIndex = identifierSerializerSeriesIdDataIndex;
|
package/internals/index.d.ts
CHANGED
|
@@ -12,13 +12,14 @@ export { scatterSeriesConfig } from "../ScatterChart/seriesConfig/index.js";
|
|
|
12
12
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
13
13
|
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
14
14
|
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
|
15
|
-
export
|
|
15
|
+
export * from "../BarChart/useBarChartProps.js";
|
|
16
16
|
export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
17
17
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
18
18
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
19
19
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
20
20
|
export * from "./seriesSelectorOfType.js";
|
|
21
21
|
export { useSkipAnimation } from "../hooks/useSkipAnimation.js";
|
|
22
|
+
export { useRegisterPointerInteractions } from "./plugins/featurePlugins/shared/useRegisterPointerInteractions.js";
|
|
22
23
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
23
24
|
export * from "./plugins/corePlugins/useChartSeries/index.js";
|
|
24
25
|
export * from "./plugins/corePlugins/useChartDimensions/index.js";
|
|
@@ -29,6 +30,7 @@ export * from "./plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
|
29
30
|
export * from "./plugins/featurePlugins/useChartTooltip/index.js";
|
|
30
31
|
export * from "./plugins/featurePlugins/useChartInteraction/index.js";
|
|
31
32
|
export * from "./plugins/featurePlugins/useChartHighlight/index.js";
|
|
33
|
+
export * from "./plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
32
34
|
export * from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
33
35
|
export * from "./plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
34
36
|
export * from "./plugins/featurePlugins/useChartBrush/index.js";
|
|
@@ -58,6 +60,7 @@ export * from "./dateHelpers.js";
|
|
|
58
60
|
export * from "./invertScale.js";
|
|
59
61
|
export * from "./scaleGuards.js";
|
|
60
62
|
export * from "./findMinMax.js";
|
|
63
|
+
export { getSeriesColorFn } from "./getSeriesColorFn.js";
|
|
61
64
|
export { checkBarChartScaleErrors } from "../BarChart/checkBarChartScaleErrors.js";
|
|
62
65
|
export { getBandSize } from "./getBandSize.js";
|
|
63
66
|
export { getAxisExtrema } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js";
|
|
@@ -71,4 +74,5 @@ export * from "./plugins/models/index.js";
|
|
|
71
74
|
export * from "./material/index.js";
|
|
72
75
|
export * from "./createSvgIcon.js";
|
|
73
76
|
export * from "./constants.js";
|
|
74
|
-
export * from "./scales/index.js";
|
|
77
|
+
export * from "./scales/index.js";
|
|
78
|
+
export * from "./identifierSerializer.js";
|
package/internals/index.js
CHANGED
|
@@ -13,12 +13,13 @@ var _exportNames = {
|
|
|
13
13
|
useLineChartProps: true,
|
|
14
14
|
useAreaPlotData: true,
|
|
15
15
|
useLinePlotData: true,
|
|
16
|
-
useBarChartProps: true,
|
|
17
16
|
useBarPlotData: true,
|
|
18
17
|
useRadarChartProps: true,
|
|
19
18
|
useSkipAnimation: true,
|
|
19
|
+
useRegisterPointerInteractions: true,
|
|
20
20
|
getCartesianAxisTriggerTooltip: true,
|
|
21
21
|
getCartesianAxisIndex: true,
|
|
22
|
+
getSeriesColorFn: true,
|
|
22
23
|
checkBarChartScaleErrors: true,
|
|
23
24
|
getBandSize: true,
|
|
24
25
|
getAxisExtrema: true
|
|
@@ -53,22 +54,22 @@ Object.defineProperty(exports, "getCartesianAxisTriggerTooltip", {
|
|
|
53
54
|
return _getAxisTriggerTooltip.getAxisTriggerTooltip;
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "getSeriesColorFn", {
|
|
57
58
|
enumerable: true,
|
|
58
59
|
get: function () {
|
|
59
|
-
return
|
|
60
|
+
return _getSeriesColorFn.getSeriesColorFn;
|
|
60
61
|
}
|
|
61
62
|
});
|
|
62
|
-
Object.defineProperty(exports, "
|
|
63
|
+
Object.defineProperty(exports, "scatterSeriesConfig", {
|
|
63
64
|
enumerable: true,
|
|
64
65
|
get: function () {
|
|
65
|
-
return
|
|
66
|
+
return _seriesConfig.scatterSeriesConfig;
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
|
-
Object.defineProperty(exports, "
|
|
69
|
+
Object.defineProperty(exports, "useAreaPlotData", {
|
|
69
70
|
enumerable: true,
|
|
70
71
|
get: function () {
|
|
71
|
-
return
|
|
72
|
+
return _useAreaPlotData.useAreaPlotData;
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
Object.defineProperty(exports, "useBarPlotData", {
|
|
@@ -107,6 +108,12 @@ Object.defineProperty(exports, "useRadarChartProps", {
|
|
|
107
108
|
return _useRadarChartProps.useRadarChartProps;
|
|
108
109
|
}
|
|
109
110
|
});
|
|
111
|
+
Object.defineProperty(exports, "useRegisterPointerInteractions", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return _useRegisterPointerInteractions.useRegisterPointerInteractions;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
110
117
|
Object.defineProperty(exports, "useScatterChartProps", {
|
|
111
118
|
enumerable: true,
|
|
112
119
|
get: function () {
|
|
@@ -201,6 +208,17 @@ var _useLineChartProps = require("../LineChart/useLineChartProps");
|
|
|
201
208
|
var _useAreaPlotData = require("../LineChart/useAreaPlotData");
|
|
202
209
|
var _useLinePlotData = require("../LineChart/useLinePlotData");
|
|
203
210
|
var _useBarChartProps = require("../BarChart/useBarChartProps");
|
|
211
|
+
Object.keys(_useBarChartProps).forEach(function (key) {
|
|
212
|
+
if (key === "default" || key === "__esModule") return;
|
|
213
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
214
|
+
if (key in exports && exports[key] === _useBarChartProps[key]) return;
|
|
215
|
+
Object.defineProperty(exports, key, {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function () {
|
|
218
|
+
return _useBarChartProps[key];
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
204
222
|
var _useBarPlotData = require("../BarChart/useBarPlotData");
|
|
205
223
|
var _useRadarChartProps = require("../RadarChart/useRadarChartProps");
|
|
206
224
|
var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
|
|
@@ -240,6 +258,7 @@ Object.keys(_seriesSelectorOfType).forEach(function (key) {
|
|
|
240
258
|
});
|
|
241
259
|
});
|
|
242
260
|
var _useSkipAnimation = require("../hooks/useSkipAnimation");
|
|
261
|
+
var _useRegisterPointerInteractions = require("./plugins/featurePlugins/shared/useRegisterPointerInteractions");
|
|
243
262
|
var _useChartId = require("./plugins/corePlugins/useChartId");
|
|
244
263
|
Object.keys(_useChartId).forEach(function (key) {
|
|
245
264
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -360,6 +379,18 @@ Object.keys(_useChartHighlight).forEach(function (key) {
|
|
|
360
379
|
}
|
|
361
380
|
});
|
|
362
381
|
});
|
|
382
|
+
var _useChartVisibilityManager = require("./plugins/featurePlugins/useChartVisibilityManager");
|
|
383
|
+
Object.keys(_useChartVisibilityManager).forEach(function (key) {
|
|
384
|
+
if (key === "default" || key === "__esModule") return;
|
|
385
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
386
|
+
if (key in exports && exports[key] === _useChartVisibilityManager[key]) return;
|
|
387
|
+
Object.defineProperty(exports, key, {
|
|
388
|
+
enumerable: true,
|
|
389
|
+
get: function () {
|
|
390
|
+
return _useChartVisibilityManager[key];
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
363
394
|
var _useChartKeyboardNavigation = require("./plugins/featurePlugins/useChartKeyboardNavigation");
|
|
364
395
|
Object.keys(_useChartKeyboardNavigation).forEach(function (key) {
|
|
365
396
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -686,6 +717,7 @@ Object.keys(_findMinMax).forEach(function (key) {
|
|
|
686
717
|
}
|
|
687
718
|
});
|
|
688
719
|
});
|
|
720
|
+
var _getSeriesColorFn = require("./getSeriesColorFn");
|
|
689
721
|
var _checkBarChartScaleErrors = require("../BarChart/checkBarChartScaleErrors");
|
|
690
722
|
var _getBandSize = require("./getBandSize");
|
|
691
723
|
var _getAxisExtrema = require("./plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema");
|
|
@@ -820,4 +852,16 @@ Object.keys(_scales).forEach(function (key) {
|
|
|
820
852
|
return _scales[key];
|
|
821
853
|
}
|
|
822
854
|
});
|
|
855
|
+
});
|
|
856
|
+
var _identifierSerializer = require("./identifierSerializer");
|
|
857
|
+
Object.keys(_identifierSerializer).forEach(function (key) {
|
|
858
|
+
if (key === "default" || key === "__esModule") return;
|
|
859
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
860
|
+
if (key in exports && exports[key] === _identifierSerializer[key]) return;
|
|
861
|
+
Object.defineProperty(exports, key, {
|
|
862
|
+
enumerable: true,
|
|
863
|
+
get: function () {
|
|
864
|
+
return _identifierSerializer[key];
|
|
865
|
+
}
|
|
866
|
+
});
|
|
823
867
|
});
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import { type D3Scale } from "../models/axis.js";
|
|
2
|
-
export declare function invertScale<T>(scale: D3Scale, data: readonly T[], value: number): number | Date | T;
|
|
1
|
+
import { type D3OrdinalScale, type D3Scale } from "../models/axis.js";
|
|
2
|
+
export declare function invertScale<T>(scale: D3Scale, data: readonly T[], value: number): number | Date | T;
|
|
3
|
+
/**
|
|
4
|
+
* Get the data index for a given value on an ordinal scale.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDataIndexForOrdinalScaleValue(scale: D3OrdinalScale, value: number): number;
|
package/internals/invertScale.js
CHANGED
|
@@ -3,12 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getDataIndexForOrdinalScaleValue = getDataIndexForOrdinalScaleValue;
|
|
6
7
|
exports.invertScale = invertScale;
|
|
7
8
|
var _scaleGuards = require("./scaleGuards");
|
|
8
9
|
function invertScale(scale, data, value) {
|
|
9
10
|
if ((0, _scaleGuards.isOrdinalScale)(scale)) {
|
|
10
|
-
const dataIndex =
|
|
11
|
+
const dataIndex = getDataIndexForOrdinalScaleValue(scale, value);
|
|
11
12
|
return data[dataIndex];
|
|
12
13
|
}
|
|
13
14
|
return scale.invert(value);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get the data index for a given value on an ordinal scale.
|
|
19
|
+
*/
|
|
20
|
+
function getDataIndexForOrdinalScaleValue(scale, value) {
|
|
21
|
+
const dataIndex = scale.bandwidth() === 0 ? Math.floor((value - Math.min(...scale.range()) + scale.step() / 2) / scale.step()) : Math.floor((value - Math.min(...scale.range())) / scale.step());
|
|
22
|
+
return dataIndex;
|
|
14
23
|
}
|
|
@@ -7,7 +7,8 @@ import { type UseChartPolarAxisSignature } from "./featurePlugins/useChartPolarA
|
|
|
7
7
|
import { type UseChartClosestPointSignature } from "./featurePlugins/useChartClosestPoint/index.js";
|
|
8
8
|
import { type UseChartZAxisSignature } from "./featurePlugins/useChartZAxis/index.js";
|
|
9
9
|
import { type UseChartBrushSignature } from "./featurePlugins/useChartBrush/index.js";
|
|
10
|
+
import { type UseChartVisibilityManagerSignature } from "./featurePlugins/useChartVisibilityManager/index.js";
|
|
10
11
|
import { type UseChartTooltipSignature } from "./featurePlugins/useChartTooltip/index.js";
|
|
11
|
-
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
12
|
-
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<TSeries>, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
13
|
-
export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartBrushSignature>, import("./models/index.js").ChartPlugin<UseChartTooltipSignature>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>];
|
|
12
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<TSeries>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
13
|
+
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<TSeries>, UseChartHighlightSignature, UseChartVisibilityManagerSignature<TSeries>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
14
|
+
export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartBrushSignature>, import("./models/index.js").ChartPlugin<UseChartTooltipSignature>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature>, import("./models/index.js").ChartPlugin<UseChartVisibilityManagerSignature<any>>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>];
|
|
@@ -11,7 +11,8 @@ var _useChartKeyboardNavigation = require("./featurePlugins/useChartKeyboardNavi
|
|
|
11
11
|
var _useChartClosestPoint = require("./featurePlugins/useChartClosestPoint");
|
|
12
12
|
var _useChartZAxis = require("./featurePlugins/useChartZAxis");
|
|
13
13
|
var _useChartBrush = require("./featurePlugins/useChartBrush");
|
|
14
|
+
var _useChartVisibilityManager = require("./featurePlugins/useChartVisibilityManager");
|
|
14
15
|
var _useChartTooltip = require("./featurePlugins/useChartTooltip");
|
|
15
16
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
16
17
|
|
|
17
|
-
const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
18
|
+
const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
|
+
import type { ChartSeriesConfig } from "../../models/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Serializes a series item identifier into a unique string using the appropriate serializer
|
|
5
|
+
* from the provided series configuration.
|
|
6
|
+
*
|
|
7
|
+
* @param {ChartSeriesConfig<ChartSeriesType>} seriesConfig - The configuration object for chart series.
|
|
8
|
+
* @param {SeriesItemIdentifier<ChartSeriesType>} identifier - The series item identifier to serialize.
|
|
9
|
+
* @returns {string} A unique string representation of the identifier.
|
|
10
|
+
* @throws Will throw an error if no serializer is found for the given series type.
|
|
11
|
+
*/
|
|
12
|
+
export declare const serializeIdentifier: <T extends ChartSeriesType, U extends {
|
|
13
|
+
type: T;
|
|
14
|
+
}>(seriesConfig: ChartSeriesConfig<T>, identifier: U) => string;
|