@mui/x-charts 8.0.0-alpha.8 → 8.0.0-alpha.9

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.
Files changed (116) hide show
  1. package/BarChart/BarChart.js +1 -1
  2. package/BarChart/plugin.js +2 -0
  3. package/CHANGELOG.md +436 -3
  4. package/ChartContainer/ChartContainer.d.ts +2 -2
  5. package/ChartContainer/ChartContainer.js +2 -2
  6. package/ChartContainer/useChartContainerProps.d.ts +1 -1
  7. package/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.d.ts +7 -7
  8. package/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
  9. package/ChartDataProvider/package.json +6 -0
  10. package/ChartDataProvider/useChartDataProviderProps.d.ts +13 -0
  11. package/ChartsSurface/ChartsSurface.d.ts +1 -1
  12. package/ChartsSurface/ChartsSurface.js +1 -1
  13. package/ChartsTooltip/utils.js +2 -0
  14. package/Gauge/GaugeProvider.js +2 -0
  15. package/LineChart/AreaPlot.js +43 -10
  16. package/LineChart/CircleMarkElement.d.ts +0 -4
  17. package/LineChart/CircleMarkElement.js +2 -7
  18. package/LineChart/LineChart.d.ts +0 -4
  19. package/LineChart/LineChart.js +1 -5
  20. package/LineChart/LineHighlightElement.d.ts +5 -1
  21. package/LineChart/LineHighlightElement.js +29 -9
  22. package/LineChart/LineHighlightPlot.js +4 -2
  23. package/LineChart/LinePlot.js +43 -9
  24. package/LineChart/MarkPlot.d.ts +0 -6
  25. package/LineChart/MarkPlot.js +6 -12
  26. package/LineChart/plugin.js +2 -0
  27. package/LineChart/useLineChartProps.js +3 -5
  28. package/PieChart/PieChart.js +1 -1
  29. package/PieChart/plugin.js +3 -1
  30. package/ScatterChart/ScatterChart.js +1 -1
  31. package/ScatterChart/plugin.js +2 -0
  32. package/context/AnimationProvider/AnimationProvider.js +1 -1
  33. package/context/InteractionSelectors.d.ts +11 -11
  34. package/context/index.d.ts +0 -2
  35. package/context/index.js +1 -2
  36. package/hooks/useLegend.js +8 -13
  37. package/index.d.ts +1 -0
  38. package/index.js +3 -2
  39. package/internals/defaultizeColor.d.ts +2 -0
  40. package/internals/index.d.ts +1 -2
  41. package/internals/index.js +1 -2
  42. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +5 -5
  43. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  44. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  45. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  46. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
  47. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts +90 -126
  48. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
  49. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +0 -1
  50. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +11 -11
  51. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  52. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -1
  53. package/models/seriesType/line.d.ts +11 -0
  54. package/modern/BarChart/BarChart.js +1 -1
  55. package/modern/BarChart/plugin.js +2 -0
  56. package/modern/ChartContainer/ChartContainer.js +2 -2
  57. package/modern/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
  58. package/modern/ChartsSurface/ChartsSurface.js +1 -1
  59. package/modern/ChartsTooltip/utils.js +2 -0
  60. package/modern/Gauge/GaugeProvider.js +2 -0
  61. package/modern/LineChart/AreaPlot.js +43 -10
  62. package/modern/LineChart/CircleMarkElement.js +2 -7
  63. package/modern/LineChart/LineChart.js +1 -5
  64. package/modern/LineChart/LineHighlightElement.js +29 -9
  65. package/modern/LineChart/LineHighlightPlot.js +4 -2
  66. package/modern/LineChart/LinePlot.js +43 -9
  67. package/modern/LineChart/MarkPlot.js +6 -12
  68. package/modern/LineChart/plugin.js +2 -0
  69. package/modern/LineChart/useLineChartProps.js +3 -5
  70. package/modern/PieChart/PieChart.js +1 -1
  71. package/modern/PieChart/plugin.js +3 -1
  72. package/modern/ScatterChart/ScatterChart.js +1 -1
  73. package/modern/ScatterChart/plugin.js +2 -0
  74. package/modern/context/AnimationProvider/AnimationProvider.js +1 -1
  75. package/modern/context/index.js +1 -2
  76. package/modern/hooks/useLegend.js +8 -13
  77. package/modern/index.js +3 -2
  78. package/modern/internals/index.js +1 -2
  79. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
  80. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
  81. package/node/BarChart/BarChart.js +2 -2
  82. package/node/BarChart/plugin.js +2 -0
  83. package/node/ChartContainer/ChartContainer.js +2 -2
  84. package/node/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
  85. package/node/ChartsSurface/ChartsSurface.js +1 -1
  86. package/node/ChartsTooltip/utils.js +1 -0
  87. package/node/Gauge/GaugeProvider.js +2 -2
  88. package/node/LineChart/AreaPlot.js +43 -10
  89. package/node/LineChart/CircleMarkElement.js +2 -7
  90. package/node/LineChart/LineChart.js +2 -6
  91. package/node/LineChart/LineHighlightElement.js +29 -9
  92. package/node/LineChart/LineHighlightPlot.js +4 -2
  93. package/node/LineChart/LinePlot.js +43 -9
  94. package/node/LineChart/MarkPlot.js +6 -12
  95. package/node/LineChart/plugin.js +2 -0
  96. package/node/LineChart/useLineChartProps.js +3 -5
  97. package/node/PieChart/PieChart.js +2 -2
  98. package/node/PieChart/plugin.js +3 -1
  99. package/node/ScatterChart/ScatterChart.js +2 -2
  100. package/node/ScatterChart/plugin.js +2 -0
  101. package/node/context/AnimationProvider/AnimationProvider.js +1 -1
  102. package/node/context/index.js +1 -12
  103. package/node/hooks/useLegend.js +8 -14
  104. package/node/index.js +12 -1
  105. package/node/internals/index.js +1 -13
  106. package/node/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
  107. package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
  108. package/package.json +3 -3
  109. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +0 -13
  110. /package/{context/ChartDataProvider → ChartDataProvider}/index.d.ts +0 -0
  111. /package/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
  112. /package/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
  113. /package/modern/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
  114. /package/modern/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
  115. /package/node/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
  116. /package/node/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
@@ -1,19 +1,12 @@
1
1
  'use client';
2
2
 
3
- import getBarLegend from "../BarChart/legend.js";
4
- import getScatterLegend from "../ScatterChart/legend.js";
5
- import getLineLegend from "../LineChart/legend.js";
6
- import getPieLegend from "../PieChart/legend.js";
3
+ import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useChartSeries/index.js";
7
4
  import { useSeries } from "./useSeries.js";
8
- const legendGetter = {
9
- bar: getBarLegend,
10
- scatter: getScatterLegend,
11
- line: getLineLegend,
12
- pie: getPieLegend
13
- };
14
- function getSeriesToDisplay(series) {
5
+ import { useStore } from "../internals/store/useStore.js";
6
+ import { useSelector } from "../internals/store/useSelector.js";
7
+ function getSeriesToDisplay(series, seriesConfig) {
15
8
  return Object.keys(series).flatMap(seriesType => {
16
- const getter = legendGetter[seriesType];
9
+ const getter = seriesConfig[seriesType].legendGetter;
17
10
  return getter === undefined ? [] : getter(series[seriesType]);
18
11
  });
19
12
  }
@@ -29,7 +22,9 @@ function getSeriesToDisplay(series) {
29
22
  */
30
23
  export function useLegend() {
31
24
  const series = useSeries();
25
+ const store = useStore();
26
+ const seriesConfig = useSelector(store, selectorChartSeriesConfig);
32
27
  return {
33
- items: getSeriesToDisplay(series)
28
+ items: getSeriesToDisplay(series, seriesConfig)
34
29
  };
35
30
  }
package/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export * from './SparkLineChart';
24
24
  export * from './Gauge';
25
25
  export * from './ChartsSurface';
26
26
  export * from './ChartContainer';
27
+ export * from './ChartDataProvider';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.0.0-alpha.8
2
+ * @mui/x-charts v8.0.0-alpha.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -30,4 +30,5 @@ export * from "./ScatterChart/index.js";
30
30
  export * from "./SparkLineChart/index.js";
31
31
  export * from "./Gauge/index.js";
32
32
  export * from "./ChartsSurface/index.js";
33
- export * from "./ChartContainer/index.js";
33
+ export * from "./ChartContainer/index.js";
34
+ export * from "./ChartDataProvider/index.js";
@@ -53,7 +53,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
53
53
  area?: boolean;
54
54
  label?: string | ((location: "tooltip" | "legend") => string);
55
55
  curve?: import("..").CurveType;
56
+ strictStepCurve?: boolean;
56
57
  showMark?: boolean | ((params: import("..").ShowMarkParams) => boolean);
58
+ shape?: "circle" | "cross" | "diamond" | "square" | "star" | "triangle" | "wye";
57
59
  disableHighlight?: boolean;
58
60
  connectNulls?: boolean;
59
61
  stackOffset?: import("..").StackOffsetType;
@@ -8,7 +8,7 @@ export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
8
8
  export { useLineChartProps } from '../LineChart/useLineChartProps';
9
9
  export { useBarChartProps } from '../BarChart/useBarChartProps';
10
10
  export * from '../ChartContainer/useChartContainerProps';
11
- export * from '../context/ChartDataProvider/useChartDataProviderProps';
11
+ export * from '../ChartDataProvider/useChartDataProviderProps';
12
12
  export * from './plugins/corePlugins/useChartId';
13
13
  export * from './plugins/corePlugins/useChartSeries';
14
14
  export * from './plugins/corePlugins/useChartDimensions';
@@ -29,7 +29,6 @@ export * from './getScale';
29
29
  export * from '../context/AnimationProvider';
30
30
  export type * from '../context/context.types';
31
31
  export { getAxisExtremum } from './plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum';
32
- export * from '../context/ChartDataProvider';
33
32
  export * from '../context/ChartProvider';
34
33
  export * from '../models/seriesType/config';
35
34
  export * from '../models/seriesType/common';
@@ -11,7 +11,7 @@ export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
11
11
  export { useLineChartProps } from "../LineChart/useLineChartProps.js";
12
12
  export { useBarChartProps } from "../BarChart/useBarChartProps.js";
13
13
  export * from "../ChartContainer/useChartContainerProps.js";
14
- export * from "../context/ChartDataProvider/useChartDataProviderProps.js";
14
+ export * from "../ChartDataProvider/useChartDataProviderProps.js";
15
15
 
16
16
  // plugins
17
17
  export * from "./plugins/corePlugins/useChartId/index.js";
@@ -38,7 +38,6 @@ export * from "./getScale.js";
38
38
 
39
39
  export * from "../context/AnimationProvider/index.js";
40
40
  export { getAxisExtremum } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js";
41
- export * from "../context/ChartDataProvider/index.js";
42
41
  export * from "../context/ChartProvider/index.js";
43
42
 
44
43
  // series configuration
@@ -67,8 +67,8 @@ export declare const selectorChartDrawingArea: ((state: import("../useChartId/us
67
67
  dependencyRecomputations: () => number;
68
68
  resetDependencyRecomputations: () => void;
69
69
  } & {
70
- argsMemoize: typeof import("reselect").weakMapMemoize;
71
70
  memoize: typeof import("reselect").weakMapMemoize;
71
+ argsMemoize: typeof import("reselect").weakMapMemoize;
72
72
  };
73
73
  export declare const selectorChartPropsSize: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("./useChartDimensions.types").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
74
74
  cacheKey: import("../../models").ChartStateCacheKey;
@@ -120,8 +120,8 @@ export declare const selectorChartPropsSize: ((state: import("../useChartId/useC
120
120
  dependencyRecomputations: () => number;
121
121
  resetDependencyRecomputations: () => void;
122
122
  } & {
123
- argsMemoize: typeof import("reselect").weakMapMemoize;
124
123
  memoize: typeof import("reselect").weakMapMemoize;
124
+ argsMemoize: typeof import("reselect").weakMapMemoize;
125
125
  };
126
126
  export declare const selectorChartContainerSize: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("./useChartDimensions.types").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
127
127
  cacheKey: import("../../models").ChartStateCacheKey;
@@ -173,8 +173,8 @@ export declare const selectorChartContainerSize: ((state: import("../useChartId/
173
173
  dependencyRecomputations: () => number;
174
174
  resetDependencyRecomputations: () => void;
175
175
  } & {
176
- argsMemoize: typeof import("reselect").weakMapMemoize;
177
176
  memoize: typeof import("reselect").weakMapMemoize;
177
+ argsMemoize: typeof import("reselect").weakMapMemoize;
178
178
  };
179
179
  /**
180
180
  * Get the id attribute of the chart.
@@ -251,14 +251,14 @@ export declare const selectorChartHasIntrinsicSize: ((state: import("../useChart
251
251
  dependencyRecomputations: () => number;
252
252
  resetDependencyRecomputations: () => void;
253
253
  } & {
254
- argsMemoize: typeof import("reselect").weakMapMemoize;
255
254
  memoize: typeof import("reselect").weakMapMemoize;
255
+ argsMemoize: typeof import("reselect").weakMapMemoize;
256
256
  }];
257
257
  recomputations: () => number;
258
258
  resetRecomputations: () => void;
259
259
  dependencyRecomputations: () => number;
260
260
  resetDependencyRecomputations: () => void;
261
261
  } & {
262
- argsMemoize: typeof import("reselect").weakMapMemoize;
263
262
  memoize: typeof import("reselect").weakMapMemoize;
263
+ argsMemoize: typeof import("reselect").weakMapMemoize;
264
264
  };
@@ -31,6 +31,6 @@ export declare const selectorChartId: ((state: import("./useChartId.types").UseC
31
31
  dependencyRecomputations: () => number;
32
32
  resetDependencyRecomputations: () => void;
33
33
  } & {
34
- argsMemoize: typeof import("reselect").weakMapMemoize;
35
34
  memoize: typeof import("reselect").weakMapMemoize;
35
+ argsMemoize: typeof import("reselect").weakMapMemoize;
36
36
  };
@@ -27,8 +27,8 @@ export declare const selectorChartSeriesProcessed: ((state: import("../useChartI
27
27
  dependencyRecomputations: () => number;
28
28
  resetDependencyRecomputations: () => void;
29
29
  } & {
30
- argsMemoize: typeof import("reselect").weakMapMemoize;
31
30
  memoize: typeof import("reselect").weakMapMemoize;
31
+ argsMemoize: typeof import("reselect").weakMapMemoize;
32
32
  };
33
33
  export declare const selectorChartSeriesConfig: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("../useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("./useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
34
34
  cacheKey: import("../../models").ChartStateCacheKey;
@@ -56,6 +56,6 @@ export declare const selectorChartSeriesConfig: ((state: import("../useChartId/u
56
56
  dependencyRecomputations: () => number;
57
57
  resetDependencyRecomputations: () => void;
58
58
  } & {
59
- argsMemoize: typeof import("reselect").weakMapMemoize;
60
59
  memoize: typeof import("reselect").weakMapMemoize;
60
+ argsMemoize: typeof import("reselect").weakMapMemoize;
61
61
  };
@@ -1,5 +1,6 @@
1
1
  export { useChartCartesianAxis } from './useChartCartesianAxis';
2
2
  export type * from './useChartCartesianAxis.types';
3
+ export * from './useChartCartesianAxis.selectors';
3
4
  export { defaultizeAxis } from './defaultizeAxis';
4
5
  export * from './computeAxisValue';
5
6
  export * from './zoom.types';
@@ -1,4 +1,5 @@
1
1
  export { useChartCartesianAxis } from "./useChartCartesianAxis.js";
2
+ export * from "./useChartCartesianAxis.selectors.js";
2
3
  export { defaultizeAxis } from "./defaultizeAxis.js";
3
4
  export * from "./computeAxisValue.js";
4
5
  export * from "./zoom.types.js";