@mui/x-charts-premium 8.22.1 → 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.
Files changed (122) hide show
  1. package/BarChartPremium/BarChartPremium.d.ts +16 -1
  2. package/BarChartPremium/BarChartPremium.js +44 -1
  3. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
  4. package/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +28 -0
  5. package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
  6. package/BarChartPremium/RangeBar/RangeBarPlot.js +141 -0
  7. package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
  8. package/BarChartPremium/RangeBar/seriesConfig/extrema.js +85 -0
  9. package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
  10. package/BarChartPremium/RangeBar/seriesConfig/getColor.js +43 -0
  11. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
  12. package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +14 -0
  13. package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
  14. package/BarChartPremium/RangeBar/seriesConfig/index.js +29 -0
  15. package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
  16. package/BarChartPremium/RangeBar/seriesConfig/legend.js +29 -0
  17. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
  18. package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +54 -0
  19. package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
  20. package/BarChartPremium/RangeBar/seriesConfig/tooltip.js +44 -0
  21. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
  22. package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +59 -0
  23. package/BarChartPremium/RangeBar/types.d.ts +22 -0
  24. package/BarChartPremium/RangeBar/types.js +5 -0
  25. package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
  26. package/BarChartPremium/RangeBar/useRangeBarPlotData.js +112 -0
  27. package/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
  28. package/BarChartPremium/RangeBar/useUtilityClasses.js +24 -0
  29. package/BarChartPremium/index.d.ts +3 -1
  30. package/BarChartPremium/index.js +25 -1
  31. package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
  32. package/BarChartPremium/useBarChartPremiumProps.js +19 -1
  33. package/CHANGELOG.md +211 -0
  34. package/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
  35. package/ChartDataProviderPremium/ChartDataProviderPremium.js +9 -1
  36. package/ChartDataProviderPremium/index.d.ts +1 -1
  37. package/ChartDataProviderPremium/index.js +7 -11
  38. package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
  39. package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +59 -0
  40. package/esm/BarChartPremium/BarChartPremium.d.ts +16 -1
  41. package/esm/BarChartPremium/BarChartPremium.js +45 -2
  42. package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
  43. package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +21 -0
  44. package/esm/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
  45. package/esm/BarChartPremium/RangeBar/RangeBarPlot.js +135 -0
  46. package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
  47. package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.js +77 -0
  48. package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
  49. package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.js +37 -0
  50. package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
  51. package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +7 -0
  52. package/esm/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
  53. package/esm/BarChartPremium/RangeBar/seriesConfig/index.js +21 -0
  54. package/esm/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
  55. package/esm/BarChartPremium/RangeBar/seriesConfig/legend.js +23 -0
  56. package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
  57. package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +47 -0
  58. package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
  59. package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.js +37 -0
  60. package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
  61. package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +53 -0
  62. package/esm/BarChartPremium/RangeBar/types.d.ts +22 -0
  63. package/esm/BarChartPremium/RangeBar/types.js +1 -0
  64. package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
  65. package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.js +105 -0
  66. package/esm/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
  67. package/esm/BarChartPremium/RangeBar/useUtilityClasses.js +15 -0
  68. package/esm/BarChartPremium/index.d.ts +3 -1
  69. package/esm/BarChartPremium/index.js +3 -1
  70. package/esm/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
  71. package/esm/BarChartPremium/useBarChartPremiumProps.js +18 -1
  72. package/esm/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
  73. package/esm/ChartDataProviderPremium/ChartDataProviderPremium.js +8 -1
  74. package/esm/ChartDataProviderPremium/index.d.ts +1 -1
  75. package/esm/ChartDataProviderPremium/index.js +1 -1
  76. package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
  77. package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +53 -0
  78. package/esm/hooks/animation/index.d.ts +1 -0
  79. package/esm/hooks/animation/index.js +1 -0
  80. package/esm/hooks/animation/useAnimateRangeBar.d.ts +18 -0
  81. package/esm/hooks/animation/useAnimateRangeBar.js +51 -0
  82. package/esm/hooks/index.d.ts +3 -1
  83. package/esm/hooks/index.js +4 -1
  84. package/esm/hooks/useRangeBarSeries.d.ts +34 -0
  85. package/esm/hooks/useRangeBarSeries.js +40 -0
  86. package/esm/index.d.ts +4 -1
  87. package/esm/index.js +5 -4
  88. package/esm/models/index.d.ts +2 -1
  89. package/esm/models/index.js +3 -1
  90. package/esm/models/seriesType/index.d.ts +1 -0
  91. package/esm/models/seriesType/index.js +1 -0
  92. package/esm/models/seriesType/rangeBar.d.ts +43 -0
  93. package/esm/models/seriesType/rangeBar.js +1 -0
  94. package/esm/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
  95. package/esm/moduleAugmentation/rangeBarOnClick.js +2 -0
  96. package/esm/typeOverloads/index.d.ts +1 -0
  97. package/esm/typeOverloads/index.js +1 -0
  98. package/esm/typeOverloads/modules.d.ts +22 -0
  99. package/esm/typeOverloads/modules.js +1 -0
  100. package/hooks/animation/index.d.ts +1 -0
  101. package/hooks/animation/index.js +16 -0
  102. package/hooks/animation/useAnimateRangeBar.d.ts +18 -0
  103. package/hooks/animation/useAnimateRangeBar.js +57 -0
  104. package/hooks/index.d.ts +3 -1
  105. package/hooks/index.js +22 -0
  106. package/hooks/useRangeBarSeries.d.ts +34 -0
  107. package/hooks/useRangeBarSeries.js +45 -0
  108. package/index.d.ts +4 -1
  109. package/index.js +26 -1
  110. package/models/index.d.ts +2 -1
  111. package/models/index.js +11 -0
  112. package/models/seriesType/index.d.ts +1 -0
  113. package/models/seriesType/index.js +16 -0
  114. package/models/seriesType/rangeBar.d.ts +43 -0
  115. package/models/seriesType/rangeBar.js +5 -0
  116. package/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
  117. package/moduleAugmentation/rangeBarOnClick.js +8 -0
  118. package/package.json +16 -6
  119. package/typeOverloads/index.d.ts +1 -0
  120. package/typeOverloads/index.js +6 -0
  121. package/typeOverloads/modules.d.ts +22 -0
  122. package/typeOverloads/modules.js +5 -0
@@ -0,0 +1,40 @@
1
+ 'use client';
2
+
3
+ import { useAllSeriesOfType, useSeriesOfType } from '@mui/x-charts/internals';
4
+
5
+ /**
6
+ * Get access to the internal state of range bar series.
7
+ *
8
+ * @param {SeriesId} seriesId The id of the series to get.
9
+ * @returns {UseRangeBarSeriesReturnValue} the range bar series
10
+ */
11
+
12
+ /**
13
+ * Get access to the internal state of range bar series.
14
+ *
15
+ * When called without arguments, it returns all range bar series.
16
+ *
17
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
18
+ */
19
+
20
+ /**
21
+ * Get access to the internal state of range bar series.
22
+ *
23
+ * @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
24
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
25
+ */
26
+
27
+ export function useRangeBarSeries(seriesIds) {
28
+ return useSeriesOfType('rangeBar', seriesIds);
29
+ }
30
+
31
+ /**
32
+ * Get access to the internal state of range bar series.
33
+ * The returned object contains:
34
+ * - series: a mapping from ids to series attributes.
35
+ * - seriesOrder: the array of series ids.
36
+ * @returns the range bar series
37
+ */
38
+ export function useRangeBarSeriesContext() {
39
+ return useAllSeriesOfType('rangeBar');
40
+ }
package/esm/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import '@mui/x-charts-pro/typeOverloads';
2
+ import "./typeOverloads/modules.js";
2
3
  export * from '@mui/x-charts/ChartsClipPath';
3
4
  export * from '@mui/x-charts/ChartsReferenceLine';
4
5
  export * from '@mui/x-charts/ChartsAxis';
@@ -37,4 +38,6 @@ export * from "./constants/index.js";
37
38
  export * from "./hooks/index.js";
38
39
  export * from "./context/index.js";
39
40
  export * from "./models/index.js";
40
- export * from "./ChartsRenderer/index.js";
41
+ export * from "./ChartsRenderer/index.js";
42
+ export * from "./ChartDataProviderPremium/index.js";
43
+ export * from "./BarChartPremium/index.js";
package/esm/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  /**
2
- * @mui/x-charts-premium v8.22.1
2
+ * @mui/x-charts-premium v8.24.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- // TODO: Add typeOverloads when available
9
- // import './typeOverloads/modules';
10
8
  import '@mui/x-charts-pro/typeOverloads';
9
+ import "./typeOverloads/modules.js";
11
10
 
12
11
  // exports from MIT package
13
12
  export * from '@mui/x-charts/ChartsClipPath';
@@ -55,4 +54,6 @@ export * from "./models/index.js";
55
54
  // export * from './locales';
56
55
 
57
56
  // Premium components
58
- export * from "./ChartsRenderer/index.js";
57
+ export * from "./ChartsRenderer/index.js";
58
+ export * from "./ChartDataProviderPremium/index.js";
59
+ export * from "./BarChartPremium/index.js";
@@ -1 +1,2 @@
1
- export * from '@mui/x-charts-pro/models';
1
+ export * from '@mui/x-charts-pro/models';
2
+ export * from "./seriesType/index.js";
@@ -1,3 +1,5 @@
1
1
  // This re-export-block is automatically generated, to customize, simply remove the block.
2
2
  export * from '@mui/x-charts-pro/models';
3
- // End of re-export-block
3
+ // End of re-export-block
4
+
5
+ export * from "./seriesType/index.js";
@@ -0,0 +1 @@
1
+ export * from "./rangeBar.js";
@@ -0,0 +1 @@
1
+ export * from "./rangeBar.js";
@@ -0,0 +1,43 @@
1
+ import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId } from '@mui/x-charts/internals';
2
+ import { type DefaultizedProps } from '@mui/x-internals/types';
3
+ /** [start, end] */
4
+ export type RangeBarValueType = [number, number];
5
+ export interface RangeBarSeriesType extends CommonSeriesType<RangeBarValueType | null>, CartesianSeriesType {
6
+ type: 'rangeBar';
7
+ /**
8
+ * Data associated to each range bar.
9
+ */
10
+ data?: ReadonlyArray<RangeBarValueType | null>;
11
+ /**
12
+ * The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used.
13
+ */
14
+ datasetKeys?: {
15
+ /**
16
+ * The key used to retrieve the start of the range from the dataset.
17
+ */
18
+ start: string;
19
+ /**
20
+ * The key used to retrieve the end of the range from the dataset.
21
+ */
22
+ end: string;
23
+ };
24
+ /**
25
+ * The label to display on the tooltip or the legend. It can be a string or a function.
26
+ */
27
+ label?: string | ((location: 'tooltip' | 'legend') => string);
28
+ /**
29
+ * Layout of the bars. All bars should have the same layout.
30
+ * @default 'vertical'
31
+ */
32
+ layout?: 'horizontal' | 'vertical';
33
+ }
34
+ /**
35
+ * An object that allows to identify a range bar.
36
+ * Used for item interaction
37
+ */
38
+ export type RangeBarItemIdentifier = {
39
+ type: 'rangeBar';
40
+ seriesId: SeriesId;
41
+ dataIndex: number;
42
+ };
43
+ export interface DefaultizedRangeBarSeriesType extends DefaultizedProps<RangeBarSeriesType, CommonDefaultizedProps | 'color' | 'layout'> {}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type RangeBarValueType } from "../models/index.js";
2
+ declare module '@mui/x-charts/models' {
3
+ interface ChartsTypeFeatureFlags {
4
+ seriesValuesOverride: RangeBarValueType | number | null | undefined;
5
+ }
6
+ }
7
+ declare const _default: {};
8
+ export default _default;
@@ -0,0 +1,2 @@
1
+ // Required to make this file into a module
2
+ export default {};
@@ -0,0 +1 @@
1
+ export {} from "./modules.js";
@@ -0,0 +1 @@
1
+ export {} from "./modules.js";
@@ -0,0 +1,22 @@
1
+ import type { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
2
+ import type { SeriesColor } from '@mui/x-charts/internals';
3
+ import type { RangeBarValueType, RangeBarSeriesType } from "../models/index.js";
4
+ import type { DefaultizedRangeBarSeriesType, RangeBarItemIdentifier } from "../models/seriesType/rangeBar.js";
5
+ import type { BarSeries } from "../BarChart/index.js";
6
+ declare module '@mui/x-charts/internals' {
7
+ interface UseBarChartPropsExtensions {
8
+ series: ReadonlyArray<BarSeries | RangeBarSeriesType>;
9
+ }
10
+ interface ChartsSeriesConfig {
11
+ rangeBar: {
12
+ seriesInput: DefaultizedProps<RangeBarSeriesType, 'id'> & MakeRequired<SeriesColor<RangeBarValueType | null>, 'color'>;
13
+ series: DefaultizedRangeBarSeriesType;
14
+ seriesLayout: {};
15
+ seriesProp: RangeBarSeriesType;
16
+ itemIdentifier: RangeBarItemIdentifier;
17
+ itemIdentifierWithData: RangeBarItemIdentifier;
18
+ valueType: RangeBarValueType | null;
19
+ axisType: 'cartesian';
20
+ };
21
+ }
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./useAnimateRangeBar.js";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useAnimateRangeBar = require("./useAnimateRangeBar");
7
+ Object.keys(_useAnimateRangeBar).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useAnimateRangeBar[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useAnimateRangeBar[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,18 @@
1
+ import type * as React from 'react';
2
+ import { type AnimatedRangeBarElementProps } from "../../BarChartPremium/RangeBar/AnimatedRangeBarElement.js";
3
+ type UseAnimateRangeBarParams = Pick<AnimatedRangeBarElementProps, 'x' | 'y' | 'xOrigin' | 'yOrigin' | 'width' | 'height' | 'skipAnimation' | 'layout'> & {
4
+ ref?: React.Ref<SVGRectElement>;
5
+ };
6
+ type UseAnimateRangeBarReturnValue = {
7
+ ref: React.Ref<SVGRectElement>;
8
+ } & Pick<AnimatedRangeBarElementProps, 'x' | 'y' | 'width' | 'height'>;
9
+ /**
10
+ * Animates a range bar from its center outwards.
11
+ * The animation only happens in the direction of the numerical axis (x-axis for vertical layout, y-axis for horizontal layout).
12
+ * The other direction remains constant during the animation.
13
+ *
14
+ * The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can
15
+ * pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
16
+ */
17
+ export declare function useAnimateRangeBar(props: UseAnimateRangeBarParams): UseAnimateRangeBarReturnValue;
18
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAnimateRangeBar = useAnimateRangeBar;
7
+ var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
8
+ var _hooks = require("@mui/x-charts/hooks");
9
+ function rangeBarPropsInterpolator(from, to) {
10
+ const interpolateX = (0, _d3Interpolate.interpolateNumber)(from.x, to.x);
11
+ const interpolateY = (0, _d3Interpolate.interpolateNumber)(from.y, to.y);
12
+ const interpolateWidth = (0, _d3Interpolate.interpolateNumber)(from.width, to.width);
13
+ const interpolateHeight = (0, _d3Interpolate.interpolateNumber)(from.height, to.height);
14
+ return t => {
15
+ return {
16
+ x: interpolateX(t),
17
+ y: interpolateY(t),
18
+ width: interpolateWidth(t),
19
+ height: interpolateHeight(t)
20
+ };
21
+ };
22
+ }
23
+
24
+ /**
25
+ * Animates a range bar from its center outwards.
26
+ * The animation only happens in the direction of the numerical axis (x-axis for vertical layout, y-axis for horizontal layout).
27
+ * The other direction remains constant during the animation.
28
+ *
29
+ * The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can
30
+ * pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
31
+ */
32
+ function useAnimateRangeBar(props) {
33
+ const initialProps = {
34
+ x: props.layout === 'vertical' ? props.x : props.x + props.width / 2,
35
+ y: props.layout === 'vertical' ? props.y + props.height / 2 : props.y,
36
+ width: props.layout === 'vertical' ? props.width : 0,
37
+ height: props.layout === 'vertical' ? 0 : props.height
38
+ };
39
+ return (0, _hooks.useAnimate)({
40
+ x: props.x,
41
+ y: props.y,
42
+ width: props.width,
43
+ height: props.height
44
+ }, {
45
+ createInterpolator: rangeBarPropsInterpolator,
46
+ applyProps(element, animatedProps) {
47
+ element.setAttribute('x', animatedProps.x.toString());
48
+ element.setAttribute('y', animatedProps.y.toString());
49
+ element.setAttribute('width', animatedProps.width.toString());
50
+ element.setAttribute('height', animatedProps.height.toString());
51
+ },
52
+ transformProps: p => p,
53
+ initialProps,
54
+ skip: props.skipAnimation,
55
+ ref: props.ref
56
+ });
57
+ }
package/hooks/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export * from '@mui/x-charts-pro/hooks';
1
+ export * from '@mui/x-charts-pro/hooks';
2
+ export * from "./animation/index.js";
3
+ export * from "./useRangeBarSeries.js";
package/hooks/index.js CHANGED
@@ -13,4 +13,26 @@ Object.keys(_hooks).forEach(function (key) {
13
13
  return _hooks[key];
14
14
  }
15
15
  });
16
+ });
17
+ var _animation = require("./animation");
18
+ Object.keys(_animation).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _animation[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _animation[key];
25
+ }
26
+ });
27
+ });
28
+ var _useRangeBarSeries = require("./useRangeBarSeries");
29
+ Object.keys(_useRangeBarSeries).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _useRangeBarSeries[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _useRangeBarSeries[key];
36
+ }
37
+ });
16
38
  });
@@ -0,0 +1,34 @@
1
+ import { type ChartSeriesDefaultized, type ProcessedSeries } from '@mui/x-charts/internals';
2
+ import { type SeriesId } from '@mui/x-charts/models';
3
+ export type UseRangeBarSeriesReturnValue = ChartSeriesDefaultized<'rangeBar'>;
4
+ export type UseRangeBarSeriesContextReturnValue = ProcessedSeries['rangeBar'];
5
+ /**
6
+ * Get access to the internal state of range bar series.
7
+ *
8
+ * @param {SeriesId} seriesId The id of the series to get.
9
+ * @returns {UseRangeBarSeriesReturnValue} the range bar series
10
+ */
11
+ export declare function useRangeBarSeries(seriesId: SeriesId): UseRangeBarSeriesReturnValue | undefined;
12
+ /**
13
+ * Get access to the internal state of range bar series.
14
+ *
15
+ * When called without arguments, it returns all range bar series.
16
+ *
17
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
18
+ */
19
+ export declare function useRangeBarSeries(): UseRangeBarSeriesReturnValue[];
20
+ /**
21
+ * Get access to the internal state of range bar series.
22
+ *
23
+ * @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
24
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
25
+ */
26
+ export declare function useRangeBarSeries(seriesIds: SeriesId[]): UseRangeBarSeriesReturnValue[];
27
+ /**
28
+ * Get access to the internal state of range bar series.
29
+ * The returned object contains:
30
+ * - series: a mapping from ids to series attributes.
31
+ * - seriesOrder: the array of series ids.
32
+ * @returns the range bar series
33
+ */
34
+ export declare function useRangeBarSeriesContext(): UseRangeBarSeriesContextReturnValue;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useRangeBarSeries = useRangeBarSeries;
8
+ exports.useRangeBarSeriesContext = useRangeBarSeriesContext;
9
+ var _internals = require("@mui/x-charts/internals");
10
+ /**
11
+ * Get access to the internal state of range bar series.
12
+ *
13
+ * @param {SeriesId} seriesId The id of the series to get.
14
+ * @returns {UseRangeBarSeriesReturnValue} the range bar series
15
+ */
16
+
17
+ /**
18
+ * Get access to the internal state of range bar series.
19
+ *
20
+ * When called without arguments, it returns all range bar series.
21
+ *
22
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
23
+ */
24
+
25
+ /**
26
+ * Get access to the internal state of range bar series.
27
+ *
28
+ * @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
29
+ * @returns {UseRangeBarSeriesReturnValue[]} the range bar series
30
+ */
31
+
32
+ function useRangeBarSeries(seriesIds) {
33
+ return (0, _internals.useSeriesOfType)('rangeBar', seriesIds);
34
+ }
35
+
36
+ /**
37
+ * Get access to the internal state of range bar series.
38
+ * The returned object contains:
39
+ * - series: a mapping from ids to series attributes.
40
+ * - seriesOrder: the array of series ids.
41
+ * @returns the range bar series
42
+ */
43
+ function useRangeBarSeriesContext() {
44
+ return (0, _internals.useAllSeriesOfType)('rangeBar');
45
+ }
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import '@mui/x-charts-pro/typeOverloads';
2
+ import "./typeOverloads/modules.js";
2
3
  export * from '@mui/x-charts/ChartsClipPath';
3
4
  export * from '@mui/x-charts/ChartsReferenceLine';
4
5
  export * from '@mui/x-charts/ChartsAxis';
@@ -37,4 +38,6 @@ export * from "./constants/index.js";
37
38
  export * from "./hooks/index.js";
38
39
  export * from "./context/index.js";
39
40
  export * from "./models/index.js";
40
- export * from "./ChartsRenderer/index.js";
41
+ export * from "./ChartsRenderer/index.js";
42
+ export * from "./ChartDataProviderPremium/index.js";
43
+ export * from "./BarChartPremium/index.js";
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-premium v8.22.1
2
+ * @mui/x-charts-premium v8.24.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "ChartContainerPro", {
20
20
  }
21
21
  });
22
22
  require("@mui/x-charts-pro/typeOverloads");
23
+ require("./typeOverloads/modules");
23
24
  var _ChartsClipPath = require("@mui/x-charts/ChartsClipPath");
24
25
  Object.keys(_ChartsClipPath).forEach(function (key) {
25
26
  if (key === "default" || key === "__esModule") return;
@@ -464,4 +465,28 @@ Object.keys(_ChartsRenderer).forEach(function (key) {
464
465
  return _ChartsRenderer[key];
465
466
  }
466
467
  });
468
+ });
469
+ var _ChartDataProviderPremium = require("./ChartDataProviderPremium");
470
+ Object.keys(_ChartDataProviderPremium).forEach(function (key) {
471
+ if (key === "default" || key === "__esModule") return;
472
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
473
+ if (key in exports && exports[key] === _ChartDataProviderPremium[key]) return;
474
+ Object.defineProperty(exports, key, {
475
+ enumerable: true,
476
+ get: function () {
477
+ return _ChartDataProviderPremium[key];
478
+ }
479
+ });
480
+ });
481
+ var _BarChartPremium = require("./BarChartPremium");
482
+ Object.keys(_BarChartPremium).forEach(function (key) {
483
+ if (key === "default" || key === "__esModule") return;
484
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
485
+ if (key in exports && exports[key] === _BarChartPremium[key]) return;
486
+ Object.defineProperty(exports, key, {
487
+ enumerable: true,
488
+ get: function () {
489
+ return _BarChartPremium[key];
490
+ }
491
+ });
467
492
  });
package/models/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from '@mui/x-charts-pro/models';
1
+ export * from '@mui/x-charts-pro/models';
2
+ export * from "./seriesType/index.js";
package/models/index.js CHANGED
@@ -13,4 +13,15 @@ Object.keys(_models).forEach(function (key) {
13
13
  return _models[key];
14
14
  }
15
15
  });
16
+ });
17
+ var _seriesType = require("./seriesType");
18
+ Object.keys(_seriesType).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _seriesType[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _seriesType[key];
25
+ }
26
+ });
16
27
  });
@@ -0,0 +1 @@
1
+ export * from "./rangeBar.js";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _rangeBar = require("./rangeBar");
7
+ Object.keys(_rangeBar).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _rangeBar[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _rangeBar[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,43 @@
1
+ import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId } from '@mui/x-charts/internals';
2
+ import { type DefaultizedProps } from '@mui/x-internals/types';
3
+ /** [start, end] */
4
+ export type RangeBarValueType = [number, number];
5
+ export interface RangeBarSeriesType extends CommonSeriesType<RangeBarValueType | null>, CartesianSeriesType {
6
+ type: 'rangeBar';
7
+ /**
8
+ * Data associated to each range bar.
9
+ */
10
+ data?: ReadonlyArray<RangeBarValueType | null>;
11
+ /**
12
+ * The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used.
13
+ */
14
+ datasetKeys?: {
15
+ /**
16
+ * The key used to retrieve the start of the range from the dataset.
17
+ */
18
+ start: string;
19
+ /**
20
+ * The key used to retrieve the end of the range from the dataset.
21
+ */
22
+ end: string;
23
+ };
24
+ /**
25
+ * The label to display on the tooltip or the legend. It can be a string or a function.
26
+ */
27
+ label?: string | ((location: 'tooltip' | 'legend') => string);
28
+ /**
29
+ * Layout of the bars. All bars should have the same layout.
30
+ * @default 'vertical'
31
+ */
32
+ layout?: 'horizontal' | 'vertical';
33
+ }
34
+ /**
35
+ * An object that allows to identify a range bar.
36
+ * Used for item interaction
37
+ */
38
+ export type RangeBarItemIdentifier = {
39
+ type: 'rangeBar';
40
+ seriesId: SeriesId;
41
+ dataIndex: number;
42
+ };
43
+ export interface DefaultizedRangeBarSeriesType extends DefaultizedProps<RangeBarSeriesType, CommonDefaultizedProps | 'color' | 'layout'> {}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,8 @@
1
+ import { type RangeBarValueType } from "../models/index.js";
2
+ declare module '@mui/x-charts/models' {
3
+ interface ChartsTypeFeatureFlags {
4
+ seriesValuesOverride: RangeBarValueType | number | null | undefined;
5
+ }
6
+ }
7
+ declare const _default: {};
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ // Required to make this file into a module
8
+ var _default = exports.default = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-premium",
3
- "version": "8.22.1",
3
+ "version": "8.24.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Premium plan edition of the MUI X Charts components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -31,11 +31,11 @@
31
31
  "@mui/utils": "^7.3.5",
32
32
  "clsx": "^2.1.1",
33
33
  "prop-types": "^15.8.1",
34
- "@mui/x-charts": "8.22.1",
35
- "@mui/x-charts-vendor": "8.22.0",
36
- "@mui/x-internals": "8.22.0",
37
- "@mui/x-charts-pro": "8.22.1",
38
- "@mui/x-license": "8.22.0"
34
+ "@mui/x-charts": "8.24.0",
35
+ "@mui/x-internals": "8.24.0",
36
+ "@mui/x-charts-pro": "8.24.0",
37
+ "@mui/x-license": "8.24.0",
38
+ "@mui/x-charts-vendor": "8.23.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@emotion/react": "^11.9.0",
@@ -84,6 +84,16 @@
84
84
  "default": "./esm/*/index.js"
85
85
  }
86
86
  },
87
+ "./moduleAugmentation/*": {
88
+ "require": {
89
+ "types": "./moduleAugmentation/*.d.ts",
90
+ "default": "./moduleAugmentation/*.js"
91
+ },
92
+ "default": {
93
+ "types": "./esm/moduleAugmentation/*.d.ts",
94
+ "default": "./esm/moduleAugmentation/*.js"
95
+ }
96
+ },
87
97
  "./esm": null
88
98
  }
89
99
  }
@@ -0,0 +1 @@
1
+ export {} from "./modules.js";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ require("./modules");
@@ -0,0 +1,22 @@
1
+ import type { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
2
+ import type { SeriesColor } from '@mui/x-charts/internals';
3
+ import type { RangeBarValueType, RangeBarSeriesType } from "../models/index.js";
4
+ import type { DefaultizedRangeBarSeriesType, RangeBarItemIdentifier } from "../models/seriesType/rangeBar.js";
5
+ import type { BarSeries } from "../BarChart/index.js";
6
+ declare module '@mui/x-charts/internals' {
7
+ interface UseBarChartPropsExtensions {
8
+ series: ReadonlyArray<BarSeries | RangeBarSeriesType>;
9
+ }
10
+ interface ChartsSeriesConfig {
11
+ rangeBar: {
12
+ seriesInput: DefaultizedProps<RangeBarSeriesType, 'id'> & MakeRequired<SeriesColor<RangeBarValueType | null>, 'color'>;
13
+ series: DefaultizedRangeBarSeriesType;
14
+ seriesLayout: {};
15
+ seriesProp: RangeBarSeriesType;
16
+ itemIdentifier: RangeBarItemIdentifier;
17
+ itemIdentifierWithData: RangeBarItemIdentifier;
18
+ valueType: RangeBarValueType | null;
19
+ axisType: 'cartesian';
20
+ };
21
+ }
22
+ }