@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.
- package/BarChartPremium/BarChartPremium.d.ts +16 -1
- package/BarChartPremium/BarChartPremium.js +44 -1
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +28 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.js +141 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.js +85 -0
- package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/getColor.js +43 -0
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +14 -0
- package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
- package/BarChartPremium/RangeBar/seriesConfig/index.js +29 -0
- package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/legend.js +29 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +54 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.js +44 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +59 -0
- package/BarChartPremium/RangeBar/types.d.ts +22 -0
- package/BarChartPremium/RangeBar/types.js +5 -0
- package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
- package/BarChartPremium/RangeBar/useRangeBarPlotData.js +112 -0
- package/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
- package/BarChartPremium/RangeBar/useUtilityClasses.js +24 -0
- package/BarChartPremium/index.d.ts +3 -1
- package/BarChartPremium/index.js +25 -1
- package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
- package/BarChartPremium/useBarChartPremiumProps.js +19 -1
- package/CHANGELOG.md +211 -0
- package/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
- package/ChartDataProviderPremium/ChartDataProviderPremium.js +9 -1
- package/ChartDataProviderPremium/index.d.ts +1 -1
- package/ChartDataProviderPremium/index.js +7 -11
- package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
- package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +59 -0
- package/esm/BarChartPremium/BarChartPremium.d.ts +16 -1
- package/esm/BarChartPremium/BarChartPremium.js +45 -2
- package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +21 -0
- package/esm/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
- package/esm/BarChartPremium/RangeBar/RangeBarPlot.js +135 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.js +77 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.js +37 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +7 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/index.js +21 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/legend.js +23 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +47 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.js +37 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +53 -0
- package/esm/BarChartPremium/RangeBar/types.d.ts +22 -0
- package/esm/BarChartPremium/RangeBar/types.js +1 -0
- package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
- package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.js +105 -0
- package/esm/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
- package/esm/BarChartPremium/RangeBar/useUtilityClasses.js +15 -0
- package/esm/BarChartPremium/index.d.ts +3 -1
- package/esm/BarChartPremium/index.js +3 -1
- package/esm/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
- package/esm/BarChartPremium/useBarChartPremiumProps.js +18 -1
- package/esm/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
- package/esm/ChartDataProviderPremium/ChartDataProviderPremium.js +8 -1
- package/esm/ChartDataProviderPremium/index.d.ts +1 -1
- package/esm/ChartDataProviderPremium/index.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
- package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +53 -0
- package/esm/hooks/animation/index.d.ts +1 -0
- package/esm/hooks/animation/index.js +1 -0
- package/esm/hooks/animation/useAnimateRangeBar.d.ts +18 -0
- package/esm/hooks/animation/useAnimateRangeBar.js +51 -0
- package/esm/hooks/index.d.ts +3 -1
- package/esm/hooks/index.js +4 -1
- package/esm/hooks/useRangeBarSeries.d.ts +34 -0
- package/esm/hooks/useRangeBarSeries.js +40 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.js +5 -4
- package/esm/models/index.d.ts +2 -1
- package/esm/models/index.js +3 -1
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/models/seriesType/rangeBar.d.ts +43 -0
- package/esm/models/seriesType/rangeBar.js +1 -0
- package/esm/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
- package/esm/moduleAugmentation/rangeBarOnClick.js +2 -0
- package/esm/typeOverloads/index.d.ts +1 -0
- package/esm/typeOverloads/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +22 -0
- package/esm/typeOverloads/modules.js +1 -0
- package/hooks/animation/index.d.ts +1 -0
- package/hooks/animation/index.js +16 -0
- package/hooks/animation/useAnimateRangeBar.d.ts +18 -0
- package/hooks/animation/useAnimateRangeBar.js +57 -0
- package/hooks/index.d.ts +3 -1
- package/hooks/index.js +22 -0
- package/hooks/useRangeBarSeries.d.ts +34 -0
- package/hooks/useRangeBarSeries.js +45 -0
- package/index.d.ts +4 -1
- package/index.js +26 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +11 -0
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +16 -0
- package/models/seriesType/rangeBar.d.ts +43 -0
- package/models/seriesType/rangeBar.js +5 -0
- package/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
- package/moduleAugmentation/rangeBarOnClick.js +8 -0
- package/package.json +16 -6
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +6 -0
- package/typeOverloads/modules.d.ts +22 -0
- 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.
|
|
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";
|
package/esm/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/esm/models/index.js
CHANGED
|
@@ -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 @@
|
|
|
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
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.
|
|
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,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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-premium",
|
|
3
|
-
"version": "8.
|
|
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.
|
|
35
|
-
"@mui/x-
|
|
36
|
-
"@mui/x-
|
|
37
|
-
"@mui/x-
|
|
38
|
-
"@mui/x-
|
|
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,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
|
+
}
|