@mui/x-charts-pro 8.27.2 → 8.27.5
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/BarChartPro/BarChartPro.js +2 -2
- package/CHANGELOG.md +154 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/ChartContainerPro/ChartContainerPro.js +14 -287
- package/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/ChartContainerPro/useChartContainerProProps.js +9 -34
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +18 -44
- package/ChartDataProviderPro/ChartDataProviderPro.js +22 -141
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +7 -7
- package/ChartDataProviderPro/useChartDataProviderProProps.js +5 -18
- package/ChartZoomSlider/index.d.ts +29 -3
- package/ChartZoomSlider/index.js +33 -30
- package/ChartsContainer/index.d.ts +1 -0
- package/ChartsContainer/index.js +16 -0
- package/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/ChartsContainerPro/ChartsContainerPro.js +188 -0
- package/ChartsContainerPro/index.d.ts +9 -0
- package/ChartsContainerPro/index.js +17 -0
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
- package/ChartsDataProvider/index.d.ts +1 -0
- package/ChartsDataProvider/index.js +16 -0
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +49 -0
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +150 -0
- package/ChartsDataProviderPro/index.d.ts +2 -0
- package/ChartsDataProviderPro/index.js +13 -0
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +10 -0
- package/ChartsDataProviderPro/useChartsDataProviderProProps.js +25 -0
- package/ChartsZoomSlider/ChartsZoomSlider.d.ts +4 -0
- package/{ChartZoomSlider/ChartZoomSlider.js → ChartsZoomSlider/ChartsZoomSlider.js} +5 -5
- package/ChartsZoomSlider/index.d.ts +3 -0
- package/ChartsZoomSlider/index.js +26 -0
- package/{ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSlider.d.ts} +3 -3
- package/{ChartZoomSlider/internals/ChartAxisZoomSlider.js → ChartsZoomSlider/internals/ChartsAxisZoomSlider.js} +8 -8
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.d.ts} +3 -3
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.js} +7 -7
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreview.d.ts} +3 -3
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreview.js} +4 -4
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderPreviewContent.d.ts +9 -0
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreviewContent.js} +2 -2
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderThumb.d.ts +12 -0
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderThumb.js} +8 -8
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.d.ts} +3 -3
- package/{ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.js} +4 -4
- package/{ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts → ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.d.ts} +5 -5
- package/{ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.js → ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.js} +2 -2
- package/ChartsZoomSlider/internals/chartsAxisZoomSliderTrackClasses.d.ts +15 -0
- package/{ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js → ChartsZoomSlider/internals/chartsAxisZoomSliderTrackClasses.js} +2 -2
- package/LineChartPro/LineChartPro.js +2 -2
- package/ScatterChartPro/ScatterChartPro.js +2 -2
- package/esm/BarChartPro/BarChartPro.js +2 -2
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/esm/ChartContainerPro/useChartContainerProProps.js +10 -33
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +18 -44
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +17 -139
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +7 -7
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +6 -17
- package/esm/ChartZoomSlider/index.d.ts +29 -3
- package/esm/ChartZoomSlider/index.js +34 -3
- package/esm/ChartsContainer/index.d.ts +1 -0
- package/esm/ChartsContainer/index.js +2 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.js +182 -0
- package/esm/ChartsContainerPro/index.d.ts +9 -0
- package/esm/ChartsContainerPro/index.js +6 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
- package/esm/ChartsDataProvider/index.d.ts +1 -0
- package/esm/ChartsDataProvider/index.js +2 -0
- package/esm/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +49 -0
- package/esm/ChartsDataProviderPro/ChartsDataProviderPro.js +144 -0
- package/esm/ChartsDataProviderPro/index.d.ts +2 -0
- package/esm/ChartsDataProviderPro/index.js +2 -0
- package/esm/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +10 -0
- package/esm/ChartsDataProviderPro/useChartsDataProviderProProps.js +19 -0
- package/esm/ChartsZoomSlider/ChartsZoomSlider.d.ts +4 -0
- package/esm/{ChartZoomSlider/ChartZoomSlider.js → ChartsZoomSlider/ChartsZoomSlider.js} +4 -4
- package/esm/ChartsZoomSlider/index.d.ts +3 -0
- package/esm/ChartsZoomSlider/index.js +3 -0
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSlider.d.ts} +3 -3
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSlider.js → ChartsZoomSlider/internals/ChartsAxisZoomSlider.js} +7 -7
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.d.ts} +3 -3
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.js} +5 -5
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreview.d.ts} +3 -3
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreview.js} +3 -3
- package/esm/ChartsZoomSlider/internals/ChartsAxisZoomSliderPreviewContent.d.ts +9 -0
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderPreviewContent.js} +1 -1
- package/esm/ChartsZoomSlider/internals/ChartsAxisZoomSliderThumb.d.ts +12 -0
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderThumb.js} +6 -6
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts → ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.d.ts} +3 -3
- package/esm/{ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js → ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.js} +2 -2
- package/esm/{ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts → ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.d.ts} +5 -5
- package/esm/{ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.js → ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.js} +1 -1
- package/esm/ChartsZoomSlider/internals/chartsAxisZoomSliderTrackClasses.d.ts +15 -0
- package/esm/{ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js → ChartsZoomSlider/internals/chartsAxisZoomSliderTrackClasses.js} +1 -1
- package/esm/LineChartPro/LineChartPro.js +2 -2
- package/esm/ScatterChartPro/ScatterChartPro.js +2 -2
- package/esm/index.d.ts +6 -1
- package/esm/index.js +5 -1
- package/esm/internals/index.d.ts +5 -3
- package/esm/internals/index.js +3 -2
- package/esm/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/index.d.ts +6 -1
- package/index.js +45 -1
- package/internals/index.d.ts +5 -3
- package/internals/index.js +10 -3
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/package.json +4 -4
- package/ChartZoomSlider/ChartZoomSlider.d.ts +0 -4
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +0 -9
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +0 -12
- package/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +0 -15
- package/esm/ChartZoomSlider/ChartZoomSlider.d.ts +0 -4
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +0 -9
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +0 -12
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +0 -15
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/ChartsTooltipZoomSliderValue.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/ChartsTooltipZoomSliderValue.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/constants.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/constants.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/AreaPreviewPlot.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/AreaPreviewPlot.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/BarPreviewPlot.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/BarPreviewPlot.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LineAreaPreviewPlot.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LineAreaPreviewPlot.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LinePreviewPlot.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LinePreviewPlot.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/PreviewPlot.types.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/PreviewPlot.types.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/ScatterPreviewPlot.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/ScatterPreviewPlot.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/seriesPreviewPlotMap.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/seriesPreviewPlotMap.js +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/zoom-utils.d.ts +0 -0
- /package/{ChartZoomSlider → ChartsZoomSlider}/internals/zoom-utils.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/ChartsTooltipZoomSliderValue.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/ChartsTooltipZoomSliderValue.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/constants.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/constants.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/AreaPreviewPlot.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/AreaPreviewPlot.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/BarPreviewPlot.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/BarPreviewPlot.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LineAreaPreviewPlot.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LineAreaPreviewPlot.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LinePreviewPlot.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/LinePreviewPlot.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/PreviewPlot.types.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/PreviewPlot.types.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/ScatterPreviewPlot.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/previews/ScatterPreviewPlot.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/seriesPreviewPlotMap.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/seriesPreviewPlotMap.js +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/zoom-utils.d.ts +0 -0
- /package/esm/{ChartZoomSlider → ChartsZoomSlider}/internals/zoom-utils.js +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type ChartSeriesType, type UseChartsContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
import type { ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
4
|
+
import type { ChartsContainerProProps } from "./ChartsContainerPro.js";
|
|
5
|
+
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
|
+
export type UseChartsContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartsContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProProps<TSeries, TSignatures>;
|
|
8
|
+
};
|
|
9
|
+
export declare const useChartsContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartsContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["initialZoom", "zoomData", "onZoomChange", "zoomInteractionConfig", "plugins", "apiRef"];
|
|
6
|
+
import { useChartsContainerProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
8
|
+
export const useChartsContainerProProps = (props, ref) => {
|
|
9
|
+
const _ref = props,
|
|
10
|
+
{
|
|
11
|
+
initialZoom,
|
|
12
|
+
zoomData,
|
|
13
|
+
onZoomChange,
|
|
14
|
+
zoomInteractionConfig,
|
|
15
|
+
plugins,
|
|
16
|
+
apiRef
|
|
17
|
+
} = _ref,
|
|
18
|
+
baseProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
+
const {
|
|
20
|
+
chartDataProviderProps,
|
|
21
|
+
chartsSurfaceProps,
|
|
22
|
+
children
|
|
23
|
+
} = useChartsContainerProps(baseProps, ref);
|
|
24
|
+
const chartDataProviderProProps = _extends({}, chartDataProviderProps, {
|
|
25
|
+
initialZoom,
|
|
26
|
+
zoomData,
|
|
27
|
+
onZoomChange,
|
|
28
|
+
zoomInteractionConfig,
|
|
29
|
+
apiRef,
|
|
30
|
+
plugins: plugins ?? DEFAULT_PLUGINS
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
chartDataProviderProProps,
|
|
34
|
+
chartsSurfaceProps,
|
|
35
|
+
children
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsDataProvider';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ChartSeriesType, type ChartAnyPluginSignature, type ChartsProviderProps, type ChartSeriesConfig } from '@mui/x-charts/internals';
|
|
2
|
+
import { type ChartsDataProviderProps } from '@mui/x-charts/ChartsDataProvider';
|
|
3
|
+
import { type ChartsSlotPropsPro, type ChartsSlotsPro } from "../internals/material/index.js";
|
|
4
|
+
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
|
+
export interface ChartsDataProviderProSlots extends ChartsSlotsPro {}
|
|
6
|
+
export interface ChartsDataProviderProSlotProps extends ChartsSlotPropsPro {}
|
|
7
|
+
export type ChartsDataProviderProProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartsDataProviderProps<TSeries, TSignatures> & ChartsProviderProps<TSeries, TSignatures>['pluginParams'] & {
|
|
8
|
+
/**
|
|
9
|
+
* Slots to customize charts' components.
|
|
10
|
+
*/
|
|
11
|
+
slots?: Partial<ChartsDataProviderProSlots>;
|
|
12
|
+
/**
|
|
13
|
+
* The props for the slots.
|
|
14
|
+
*/
|
|
15
|
+
slotProps?: Partial<ChartsDataProviderProSlotProps>;
|
|
16
|
+
};
|
|
17
|
+
export declare const defaultSeriesConfigPro: ChartSeriesConfig<'bar' | 'scatter' | 'line' | 'pie'>;
|
|
18
|
+
/**
|
|
19
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
20
|
+
*
|
|
21
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
22
|
+
*
|
|
23
|
+
* Demos:
|
|
24
|
+
*
|
|
25
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/)
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx
|
|
33
|
+
* <ChartsDataProviderPro
|
|
34
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
35
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
36
|
+
* >
|
|
37
|
+
* <ChartsSurface>
|
|
38
|
+
* <BarPlot />
|
|
39
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
40
|
+
* </ChartsSurface>
|
|
41
|
+
* {'Custom Legend Component'}
|
|
42
|
+
* </ChartsDataProviderPro>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function ChartsDataProviderPro<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsDataProviderProProps<TSeries, TSignatures>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
declare namespace ChartsDataProviderPro {
|
|
47
|
+
var propTypes: any;
|
|
48
|
+
}
|
|
49
|
+
export { ChartsDataProviderPro };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { Watermark } from '@mui/x-license/Watermark';
|
|
6
|
+
import { ChartsProvider, ChartsSlotsProvider, defaultSeriesConfig } from '@mui/x-charts/internals';
|
|
7
|
+
import { ChartsLocalizationProvider } from '@mui/x-charts/ChartsLocalizationProvider';
|
|
8
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
9
|
+
import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
10
|
+
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
11
|
+
import { useChartsDataProviderProProps } from "./useChartsDataProviderProProps.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const releaseInfo = "MTc3MzE4NzIwMDAwMA==";
|
|
14
|
+
const packageIdentifier = 'x-charts-pro';
|
|
15
|
+
export const defaultSeriesConfigPro = defaultSeriesConfig;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
19
|
+
*
|
|
20
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
21
|
+
*
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
25
|
+
*
|
|
26
|
+
* API:
|
|
27
|
+
*
|
|
28
|
+
* - [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <ChartsDataProviderPro
|
|
33
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
34
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
35
|
+
* >
|
|
36
|
+
* <ChartsSurface>
|
|
37
|
+
* <BarPlot />
|
|
38
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
39
|
+
* </ChartsSurface>
|
|
40
|
+
* {'Custom Legend Component'}
|
|
41
|
+
* </ChartsDataProviderPro>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
function ChartsDataProviderPro(props) {
|
|
45
|
+
const {
|
|
46
|
+
children,
|
|
47
|
+
localeText,
|
|
48
|
+
chartProviderProps,
|
|
49
|
+
slots,
|
|
50
|
+
slotProps
|
|
51
|
+
} = useChartsDataProviderProProps(_extends({}, props, {
|
|
52
|
+
seriesConfig: props.seriesConfig ?? defaultSeriesConfigPro,
|
|
53
|
+
plugins: props.plugins ?? DEFAULT_PLUGINS
|
|
54
|
+
}));
|
|
55
|
+
useLicenseVerifier(packageIdentifier, releaseInfo);
|
|
56
|
+
return /*#__PURE__*/_jsxs(ChartsProvider, _extends({}, chartProviderProps, {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(ChartsLocalizationProvider, {
|
|
58
|
+
localeText: localeText,
|
|
59
|
+
children: /*#__PURE__*/_jsx(ChartsSlotsProvider, {
|
|
60
|
+
slots: slots,
|
|
61
|
+
slotProps: slotProps,
|
|
62
|
+
defaultSlots: defaultSlotsMaterial,
|
|
63
|
+
children: children
|
|
64
|
+
})
|
|
65
|
+
}), /*#__PURE__*/_jsx(Watermark, {
|
|
66
|
+
packageName: packageIdentifier,
|
|
67
|
+
releaseInfo: releaseInfo
|
|
68
|
+
})]
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
process.env.NODE_ENV !== "production" ? ChartsDataProviderPro.propTypes = {
|
|
72
|
+
// ----------------------------- Warning --------------------------------
|
|
73
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
74
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
75
|
+
// ----------------------------------------------------------------------
|
|
76
|
+
apiRef: PropTypes.shape({
|
|
77
|
+
current: PropTypes.any
|
|
78
|
+
}),
|
|
79
|
+
/**
|
|
80
|
+
* Color palette used to colorize multiple series.
|
|
81
|
+
* @default rainbowSurgePalette
|
|
82
|
+
*/
|
|
83
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
84
|
+
/**
|
|
85
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
86
|
+
*/
|
|
87
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
88
|
+
/**
|
|
89
|
+
* Options to enable features planned for the next major.
|
|
90
|
+
*/
|
|
91
|
+
experimentalFeatures: PropTypes.shape({
|
|
92
|
+
preferStrictDomainInLineCharts: PropTypes.bool
|
|
93
|
+
}),
|
|
94
|
+
/**
|
|
95
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
96
|
+
*/
|
|
97
|
+
height: PropTypes.number,
|
|
98
|
+
/**
|
|
99
|
+
* This prop is used to help implement the accessibility logic.
|
|
100
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
101
|
+
*/
|
|
102
|
+
id: PropTypes.string,
|
|
103
|
+
/**
|
|
104
|
+
* Localized text for chart components.
|
|
105
|
+
*/
|
|
106
|
+
localeText: PropTypes.object,
|
|
107
|
+
/**
|
|
108
|
+
* The margin between the SVG and the drawing area.
|
|
109
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
110
|
+
*
|
|
111
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
112
|
+
*/
|
|
113
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
114
|
+
bottom: PropTypes.number,
|
|
115
|
+
left: PropTypes.number,
|
|
116
|
+
right: PropTypes.number,
|
|
117
|
+
top: PropTypes.number
|
|
118
|
+
})]),
|
|
119
|
+
/**
|
|
120
|
+
* The array of series to display.
|
|
121
|
+
* Each type of series has its own specificity.
|
|
122
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
123
|
+
*/
|
|
124
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
125
|
+
/**
|
|
126
|
+
* If `true`, animations are skipped.
|
|
127
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
128
|
+
*/
|
|
129
|
+
skipAnimation: PropTypes.bool,
|
|
130
|
+
/**
|
|
131
|
+
* The props for the slots.
|
|
132
|
+
*/
|
|
133
|
+
slotProps: PropTypes.object,
|
|
134
|
+
/**
|
|
135
|
+
* Slots to customize charts' components.
|
|
136
|
+
*/
|
|
137
|
+
slots: PropTypes.object,
|
|
138
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
139
|
+
/**
|
|
140
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
141
|
+
*/
|
|
142
|
+
width: PropTypes.number
|
|
143
|
+
} : void 0;
|
|
144
|
+
export { ChartsDataProviderPro };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type ChartSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartsDataProviderProProps } from "./ChartsDataProviderPro.js";
|
|
3
|
+
import type { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
4
|
+
export declare const useChartsDataProviderProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsDataProviderProProps<TSeries, TSignatures>) => {
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
localeText: Partial<import("@mui/x-charts/locales").ChartsLocaleText> | undefined;
|
|
7
|
+
chartProviderProps: import("@mui/x-charts/internals").ChartsProviderProps<TSeries, TSignatures>;
|
|
8
|
+
slots: Partial<import("@mui/x-charts").ChartsDataProviderSlots> | undefined;
|
|
9
|
+
slotProps: Partial<import("@mui/x-charts").ChartsDataProviderSlotProps> | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useChartsDataProviderProps } from '@mui/x-charts/internals';
|
|
4
|
+
export const useChartsDataProviderProProps = props => {
|
|
5
|
+
const {
|
|
6
|
+
chartProviderProps,
|
|
7
|
+
localeText,
|
|
8
|
+
slots,
|
|
9
|
+
slotProps,
|
|
10
|
+
children
|
|
11
|
+
} = useChartsDataProviderProps(props);
|
|
12
|
+
return {
|
|
13
|
+
children,
|
|
14
|
+
localeText,
|
|
15
|
+
chartProviderProps,
|
|
16
|
+
slots,
|
|
17
|
+
slotProps
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useXAxes, useYAxes } from '@mui/x-charts/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { ChartsAxisZoomSlider } from "./internals/ChartsAxisZoomSlider.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Renders the zoom slider for all x and y axes that have it enabled.
|
|
7
7
|
*/
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export function
|
|
9
|
+
export function ChartsZoomSlider() {
|
|
10
10
|
const {
|
|
11
11
|
xAxisIds,
|
|
12
12
|
xAxis: xAxes
|
|
@@ -22,7 +22,7 @@ export function ChartZoomSlider() {
|
|
|
22
22
|
if (!slider?.enabled) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
return /*#__PURE__*/_jsx(
|
|
25
|
+
return /*#__PURE__*/_jsx(ChartsAxisZoomSlider, {
|
|
26
26
|
axisId: axisId,
|
|
27
27
|
axisDirection: "x"
|
|
28
28
|
}, axisId);
|
|
@@ -32,7 +32,7 @@ export function ChartZoomSlider() {
|
|
|
32
32
|
if (!slider?.enabled) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
return /*#__PURE__*/_jsx(
|
|
35
|
+
return /*#__PURE__*/_jsx(ChartsAxisZoomSlider, {
|
|
36
36
|
axisId: axisId,
|
|
37
37
|
axisDirection: "y"
|
|
38
38
|
}, axisId);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ChartsZoomSlider } from "./ChartsZoomSlider.js";
|
|
2
|
+
export { type ChartsAxisZoomSliderThumbClasses, type ChartsAxisZoomSliderThumbClassKey, chartsAxisZoomSliderThumbClasses } from "./internals/chartsAxisZoomSliderThumbClasses.js";
|
|
3
|
+
export { type ChartsAxisZoomSliderTrackClasses, type ChartsAxisZoomSliderTrackClassKey, chartsAxisZoomSliderTrackClasses } from "./internals/chartsAxisZoomSliderTrackClasses.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AxisId } from '@mui/x-charts/internals';
|
|
2
|
-
interface
|
|
2
|
+
interface ChartsZoomSliderProps {
|
|
3
3
|
/**
|
|
4
4
|
* The ID of the axis this overview refers to.
|
|
5
5
|
*/
|
|
@@ -13,8 +13,8 @@ interface ChartZoomSliderProps {
|
|
|
13
13
|
* Renders the zoom slider for a specific axis.
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function ChartsAxisZoomSlider({
|
|
17
17
|
axisDirection,
|
|
18
18
|
axisId
|
|
19
|
-
}:
|
|
19
|
+
}: ChartsZoomSliderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
export {};
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { DEFAULT_ZOOM_SLIDER_SHOW_TOOLTIP, selectorChartAxisZoomOptionsLookup, useDrawingArea, useStore, ZOOM_SLIDER_MARGIN, ZOOM_SLIDER_PREVIEW_SIZE } from '@mui/x-charts/internals';
|
|
5
5
|
import { useXAxes, useYAxes } from '@mui/x-charts/hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { ChartsAxisZoomSliderPreview } from "./ChartsAxisZoomSliderPreview.js";
|
|
7
7
|
import { ZOOM_SLIDER_ACTIVE_TRACK_SIZE, ZOOM_SLIDER_SIZE, ZOOM_SLIDER_TRACK_SIZE } from "./constants.js";
|
|
8
8
|
import { selectorChartAxisZoomData } from "../../internals/plugins/useChartProZoom/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { ChartsAxisZoomSliderTrack } from "./ChartsAxisZoomSliderTrack.js";
|
|
10
|
+
import { ChartsAxisZoomSliderActiveTrack } from "./ChartsAxisZoomSliderActiveTrack.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
13
|
* Renders the zoom slider for a specific axis.
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export function
|
|
16
|
+
export function ChartsAxisZoomSlider({
|
|
17
17
|
axisDirection,
|
|
18
18
|
axisId
|
|
19
19
|
}) {
|
|
@@ -62,7 +62,7 @@ export function ChartAxisZoomSlider({
|
|
|
62
62
|
tooltipConditions = axis.zoom?.slider?.showTooltip ?? DEFAULT_ZOOM_SLIDER_SHOW_TOOLTIP;
|
|
63
63
|
}
|
|
64
64
|
const backgroundRectOffset = (sliderSize - ZOOM_SLIDER_TRACK_SIZE) / 2;
|
|
65
|
-
const track = showPreview ? /*#__PURE__*/_jsx(
|
|
65
|
+
const track = showPreview ? /*#__PURE__*/_jsx(ChartsAxisZoomSliderPreview, {
|
|
66
66
|
axisId: axisId,
|
|
67
67
|
axisDirection: axisDirection,
|
|
68
68
|
reverse: reverse,
|
|
@@ -70,7 +70,7 @@ export function ChartAxisZoomSlider({
|
|
|
70
70
|
y: 0,
|
|
71
71
|
height: axisDirection === 'x' ? ZOOM_SLIDER_PREVIEW_SIZE : drawingArea.height,
|
|
72
72
|
width: axisDirection === 'x' ? drawingArea.width : ZOOM_SLIDER_PREVIEW_SIZE
|
|
73
|
-
}) : /*#__PURE__*/_jsx(
|
|
73
|
+
}) : /*#__PURE__*/_jsx(ChartsAxisZoomSliderTrack, {
|
|
74
74
|
x: axisDirection === 'x' ? 0 : backgroundRectOffset,
|
|
75
75
|
y: axisDirection === 'x' ? backgroundRectOffset : 0,
|
|
76
76
|
height: axisDirection === 'x' ? ZOOM_SLIDER_TRACK_SIZE : drawingArea.height,
|
|
@@ -89,7 +89,7 @@ export function ChartAxisZoomSlider({
|
|
|
89
89
|
style: {
|
|
90
90
|
touchAction: 'none'
|
|
91
91
|
},
|
|
92
|
-
children: [track, /*#__PURE__*/_jsx(
|
|
92
|
+
children: [track, /*#__PURE__*/_jsx(ChartsAxisZoomSliderActiveTrack, {
|
|
93
93
|
zoomData: zoomData,
|
|
94
94
|
axisId: axisId,
|
|
95
95
|
axisPosition: axisPosition,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AxisId, type ZoomData } from '@mui/x-charts/internals';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ChartsAxisZoomSliderActiveTrackProps {
|
|
3
3
|
axisId: AxisId;
|
|
4
4
|
axisDirection: 'x' | 'y';
|
|
5
5
|
axisPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -11,7 +11,7 @@ export interface ChartAxisZoomSliderActiveTrackProps {
|
|
|
11
11
|
onPointerEnter?: () => void;
|
|
12
12
|
onPointerLeave?: () => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function ChartsAxisZoomSliderActiveTrack({
|
|
15
15
|
axisId,
|
|
16
16
|
axisDirection,
|
|
17
17
|
axisPosition,
|
|
@@ -22,4 +22,4 @@ export declare function ChartAxisZoomSliderActiveTrack({
|
|
|
22
22
|
showTooltip,
|
|
23
23
|
onPointerEnter,
|
|
24
24
|
onPointerLeave
|
|
25
|
-
}:
|
|
25
|
+
}: ChartsAxisZoomSliderActiveTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,11 +7,11 @@ import * as React from 'react';
|
|
|
7
7
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
8
8
|
import { shouldForwardProp } from '@mui/system';
|
|
9
9
|
import { selectorChartAxisZoomData } from "../../internals/plugins/useChartProZoom/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { ChartsAxisZoomSliderThumb } from "./ChartsAxisZoomSliderThumb.js";
|
|
11
11
|
import { ChartsTooltipZoomSliderValue } from "./ChartsTooltipZoomSliderValue.js";
|
|
12
12
|
import { calculateZoomEnd, calculateZoomFromPoint, calculateZoomStart } from "./zoom-utils.js";
|
|
13
13
|
import { ZOOM_SLIDER_THUMB_HEIGHT, ZOOM_SLIDER_THUMB_WIDTH } from "./constants.js";
|
|
14
|
-
import { useUtilityClasses } from "./
|
|
14
|
+
import { useUtilityClasses } from "./chartsAxisZoomSliderTrackClasses.js";
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const ZoomSliderActiveTrackRect = styled('rect', {
|
|
17
17
|
slot: 'internal',
|
|
@@ -39,7 +39,7 @@ const ZoomSliderActiveTrackRect = styled('rect', {
|
|
|
39
39
|
})
|
|
40
40
|
}]
|
|
41
41
|
}));
|
|
42
|
-
export function
|
|
42
|
+
export function ChartsAxisZoomSliderActiveTrack({
|
|
43
43
|
axisId,
|
|
44
44
|
axisDirection,
|
|
45
45
|
axisPosition,
|
|
@@ -224,7 +224,7 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
224
224
|
onPointerEnter: onPointerEnter,
|
|
225
225
|
onPointerLeave: onPointerLeave,
|
|
226
226
|
className: classes.active
|
|
227
|
-
}), /*#__PURE__*/_jsx(
|
|
227
|
+
}), /*#__PURE__*/_jsx(ChartsAxisZoomSliderThumb, {
|
|
228
228
|
ref: setStartThumbEl,
|
|
229
229
|
x: startThumbX,
|
|
230
230
|
y: startThumbY,
|
|
@@ -235,7 +235,7 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
235
235
|
onPointerEnter: onPointerEnter,
|
|
236
236
|
onPointerLeave: onPointerLeave,
|
|
237
237
|
placement: "start"
|
|
238
|
-
}), /*#__PURE__*/_jsx(
|
|
238
|
+
}), /*#__PURE__*/_jsx(ChartsAxisZoomSliderThumb, {
|
|
239
239
|
ref: setEndThumbEl,
|
|
240
240
|
x: endThumbX,
|
|
241
241
|
y: endThumbY,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AxisId } from '@mui/x-charts/internals';
|
|
2
|
-
interface
|
|
2
|
+
interface ChartsAxisZoomSliderPreviewProps {
|
|
3
3
|
axisId: AxisId;
|
|
4
4
|
axisDirection: 'x' | 'y';
|
|
5
5
|
reverse: boolean;
|
|
@@ -8,10 +8,10 @@ interface ChartAxisZoomSliderPreviewProps {
|
|
|
8
8
|
height: number;
|
|
9
9
|
width: number;
|
|
10
10
|
}
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function ChartsAxisZoomSliderPreview({
|
|
12
12
|
axisId,
|
|
13
13
|
axisDirection,
|
|
14
14
|
reverse,
|
|
15
15
|
...props
|
|
16
|
-
}:
|
|
16
|
+
}: ChartsAxisZoomSliderPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -7,7 +7,7 @@ import { selectorChartAxisZoomOptionsLookup, useStore } from '@mui/x-charts/inte
|
|
|
7
7
|
import { alpha } from '@mui/system';
|
|
8
8
|
import useId from '@mui/utils/useId';
|
|
9
9
|
import { selectorChartAxisZoomData } from "../../internals/plugins/useChartProZoom/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { ChartsAxisZoomSliderPreviewContent } from "./ChartsAxisZoomSliderPreviewContent.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const PreviewBackgroundRect = styled('rect', {
|
|
13
13
|
slot: 'internal',
|
|
@@ -20,7 +20,7 @@ const PreviewBackgroundRect = styled('rect', {
|
|
|
20
20
|
stroke: theme.palette.grey[700],
|
|
21
21
|
fill: alpha(theme.palette.grey[700], 0.4)
|
|
22
22
|
}));
|
|
23
|
-
export function
|
|
23
|
+
export function ChartsAxisZoomSliderPreview(_ref) {
|
|
24
24
|
let {
|
|
25
25
|
axisId,
|
|
26
26
|
axisDirection
|
|
@@ -34,7 +34,7 @@ export function ChartAxisZoomSliderPreview(_ref) {
|
|
|
34
34
|
fill: "transparent",
|
|
35
35
|
rx: 4,
|
|
36
36
|
ry: 4
|
|
37
|
-
})), /*#__PURE__*/_jsx(
|
|
37
|
+
})), /*#__PURE__*/_jsx(ChartsAxisZoomSliderPreviewContent, _extends({
|
|
38
38
|
axisId: axisId
|
|
39
39
|
}, props))]
|
|
40
40
|
}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type AxisId } from '@mui/x-charts/internals';
|
|
2
|
+
export interface ChartsAxisZoomSliderPreviewContentProps {
|
|
3
|
+
axisId: AxisId;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
height: number;
|
|
7
|
+
width: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function ChartsAxisZoomSliderPreviewContent(props: ChartsAxisZoomSliderPreviewContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { selectorChartSeriesProcessed, useStore } from '@mui/x-charts/internals';
|
|
4
4
|
import { seriesPreviewPlotMap } from "./seriesPreviewPlotMap.js";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
export function
|
|
6
|
+
export function ChartsAxisZoomSliderPreviewContent(props) {
|
|
7
7
|
const {
|
|
8
8
|
axisId,
|
|
9
9
|
x,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ChartsZoomSliderThumbOwnerState {
|
|
3
|
+
onMove: (event: PointerEvent) => void;
|
|
4
|
+
orientation: 'horizontal' | 'vertical';
|
|
5
|
+
placement: 'start' | 'end';
|
|
6
|
+
}
|
|
7
|
+
export interface ChartsZoomSliderThumbProps extends Omit<React.ComponentProps<'rect'>, 'orientation'>, ChartsZoomSliderThumbOwnerState {}
|
|
8
|
+
/**
|
|
9
|
+
* Renders the zoom slider thumb, which is responsible for resizing the zoom range.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const ChartsAxisZoomSliderThumb: React.ForwardRefExoticComponent<Omit<ChartsZoomSliderThumbProps, "ref"> & React.RefAttributes<SVGRectElement>>;
|
|
@@ -9,7 +9,7 @@ import useForkRef from '@mui/utils/useForkRef';
|
|
|
9
9
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
10
10
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
|
-
import {
|
|
12
|
+
import { chartsAxisZoomSliderThumbClasses, useUtilityClasses } from "./chartsAxisZoomSliderThumbClasses.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const Rect = styled('rect', {
|
|
15
15
|
slot: 'internal',
|
|
@@ -17,17 +17,17 @@ const Rect = styled('rect', {
|
|
|
17
17
|
})(({
|
|
18
18
|
theme
|
|
19
19
|
}) => ({
|
|
20
|
-
[`&.${
|
|
20
|
+
[`&.${chartsAxisZoomSliderThumbClasses.root}`]: _extends({
|
|
21
21
|
fill: (theme.vars || theme).palette.common.white,
|
|
22
22
|
stroke: (theme.vars || theme).palette.grey[500]
|
|
23
23
|
}, theme.applyStyles('dark', {
|
|
24
24
|
fill: (theme.vars || theme).palette.grey[300],
|
|
25
25
|
stroke: (theme.vars || theme).palette.grey[600]
|
|
26
26
|
})),
|
|
27
|
-
[`&.${
|
|
27
|
+
[`&.${chartsAxisZoomSliderThumbClasses.horizontal}`]: {
|
|
28
28
|
cursor: 'ew-resize'
|
|
29
29
|
},
|
|
30
|
-
[`&.${
|
|
30
|
+
[`&.${chartsAxisZoomSliderThumbClasses.vertical}`]: {
|
|
31
31
|
cursor: 'ns-resize'
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
@@ -39,7 +39,7 @@ function preventDefault(event) {
|
|
|
39
39
|
* Renders the zoom slider thumb, which is responsible for resizing the zoom range.
|
|
40
40
|
* @internal
|
|
41
41
|
*/
|
|
42
|
-
export const
|
|
42
|
+
export const ChartsAxisZoomSliderThumb = /*#__PURE__*/React.forwardRef(function ChartsAxisZoomSliderThumb(_ref, forwardedRef) {
|
|
43
43
|
let {
|
|
44
44
|
className,
|
|
45
45
|
onMove,
|
|
@@ -102,4 +102,4 @@ export const ChartAxisZoomSliderThumb = /*#__PURE__*/React.forwardRef(function C
|
|
|
102
102
|
ry: ry
|
|
103
103
|
}, other));
|
|
104
104
|
});
|
|
105
|
-
if (process.env.NODE_ENV !== "production")
|
|
105
|
+
if (process.env.NODE_ENV !== "production") ChartsAxisZoomSliderThumb.displayName = "ChartsAxisZoomSliderThumb";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type AxisId } from '@mui/x-charts/internals';
|
|
3
|
-
interface
|
|
3
|
+
interface ChartsAxisZoomSliderTrackProps extends React.ComponentProps<'rect'> {
|
|
4
4
|
axisId: AxisId;
|
|
5
5
|
axisDirection: 'x' | 'y';
|
|
6
6
|
reverse: boolean;
|
|
7
7
|
onSelectStart?: () => void;
|
|
8
8
|
onSelectEnd?: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function ChartsAxisZoomSliderTrack({
|
|
11
11
|
axisId,
|
|
12
12
|
axisDirection,
|
|
13
13
|
reverse,
|
|
14
14
|
onSelectStart,
|
|
15
15
|
onSelectEnd,
|
|
16
16
|
...other
|
|
17
|
-
}:
|
|
17
|
+
}: ChartsAxisZoomSliderTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -10,7 +10,7 @@ import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
|
10
10
|
import { shouldForwardProp } from '@mui/system';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import { calculateZoomEnd, calculateZoomFromPoint, calculateZoomStart } from "./zoom-utils.js";
|
|
13
|
-
import { useUtilityClasses } from "./
|
|
13
|
+
import { useUtilityClasses } from "./chartsAxisZoomSliderTrackClasses.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const ZoomSliderTrack = styled('rect', {
|
|
16
16
|
slot: 'internal',
|
|
@@ -41,7 +41,7 @@ const ZoomSliderTrack = styled('rect', {
|
|
|
41
41
|
}
|
|
42
42
|
}]
|
|
43
43
|
}));
|
|
44
|
-
export function
|
|
44
|
+
export function ChartsAxisZoomSliderTrack(_ref) {
|
|
45
45
|
let {
|
|
46
46
|
axisId,
|
|
47
47
|
axisDirection,
|