@mui/x-charts-pro 8.5.0 → 8.5.2
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.d.ts +3 -2
- package/BarChartPro/BarChartPro.js +1 -1
- package/CHANGELOG.md +204 -0
- package/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +42 -9
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -4
- package/ChartsToolbarPro/ChartsToolbarPro.js +7 -13
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +7 -6
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +7 -6
- package/ChartsToolbarPro/Toolbar.types.d.ts +15 -0
- package/ChartsToolbarPro/Toolbar.types.js +5 -0
- package/ChartsToolbarPro/index.d.ts +2 -2
- package/ChartsToolbarPro/index.js +8 -8
- package/FunnelChart/FunnelChart.js +4 -11
- package/FunnelChart/FunnelChart.plugins.d.ts +3 -2
- package/FunnelChart/FunnelChart.plugins.js +2 -1
- package/FunnelChart/FunnelPlot.d.ts +0 -5
- package/FunnelChart/FunnelPlot.js +40 -50
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/FunnelChart/FunnelSectionLabel.js +52 -0
- package/FunnelChart/categoryAxis.types.d.ts +2 -1
- package/FunnelChart/curves/bump.d.ts +9 -5
- package/FunnelChart/curves/bump.js +72 -43
- package/FunnelChart/curves/curve.types.d.ts +6 -1
- package/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/FunnelChart/curves/linear.d.ts +10 -2
- package/FunnelChart/curves/linear.js +97 -17
- package/FunnelChart/curves/pyramid.js +10 -14
- package/FunnelChart/curves/step-pyramid.js +4 -6
- package/FunnelChart/curves/step.js +1 -15
- package/FunnelChart/funnel.types.d.ts +1 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +25 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.js +124 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +3 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +173 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +27 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.js +5 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +1482 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js +27 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/FunnelChart/funnelSectionClasses.js +17 -4
- package/FunnelChart/index.d.ts +3 -1
- package/FunnelChart/index.js +18 -2
- package/FunnelChart/labelUtils.d.ts +3 -2
- package/FunnelChart/labelUtils.js +15 -15
- package/FunnelChart/positionGetter.d.ts +1 -0
- package/FunnelChart/positionGetter.js +5 -0
- package/FunnelChart/useFunnelChartProps.js +1 -3
- package/Heatmap/Heatmap.d.ts +8 -3
- package/Heatmap/Heatmap.js +10 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/LineChartPro/LineChartPro.d.ts +3 -2
- package/LineChartPro/LineChartPro.js +1 -1
- package/PieChartPro/PieChartPro.d.ts +22 -0
- package/PieChartPro/PieChartPro.js +204 -0
- package/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/PieChartPro/PieChartPro.plugins.js +9 -0
- package/PieChartPro/index.d.ts +1 -0
- package/PieChartPro/index.js +16 -0
- package/RadarChartPro/RadarChartPro.d.ts +17 -2
- package/RadarChartPro/RadarChartPro.js +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +3 -2
- package/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/BarChartPro/BarChartPro.d.ts +3 -2
- package/esm/BarChartPro/BarChartPro.js +1 -1
- package/esm/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +43 -10
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -4
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +8 -14
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/Toolbar.types.d.ts +15 -0
- package/esm/ChartsToolbarPro/Toolbar.types.js +1 -0
- package/esm/ChartsToolbarPro/index.d.ts +2 -2
- package/esm/ChartsToolbarPro/index.js +2 -2
- package/esm/FunnelChart/FunnelChart.js +4 -11
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +3 -2
- package/esm/FunnelChart/FunnelChart.plugins.js +3 -2
- package/esm/FunnelChart/FunnelPlot.d.ts +0 -5
- package/esm/FunnelChart/FunnelPlot.js +41 -51
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/esm/FunnelChart/FunnelSectionLabel.js +46 -0
- package/esm/FunnelChart/categoryAxis.types.d.ts +2 -1
- package/esm/FunnelChart/curves/bump.d.ts +9 -5
- package/esm/FunnelChart/curves/bump.js +72 -43
- package/esm/FunnelChart/curves/curve.types.d.ts +6 -1
- package/esm/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/esm/FunnelChart/curves/linear.d.ts +10 -2
- package/esm/FunnelChart/curves/linear.js +97 -17
- package/esm/FunnelChart/curves/pyramid.js +10 -14
- package/esm/FunnelChart/curves/step-pyramid.js +4 -6
- package/esm/FunnelChart/curves/step.js +1 -15
- package/esm/FunnelChart/funnel.types.d.ts +1 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +25 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.js +114 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +3 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +165 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +27 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.js +1 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +1482 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js +20 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/esm/FunnelChart/funnelSectionClasses.js +15 -3
- package/esm/FunnelChart/index.d.ts +3 -1
- package/esm/FunnelChart/index.js +3 -1
- package/esm/FunnelChart/labelUtils.d.ts +3 -2
- package/esm/FunnelChart/labelUtils.js +15 -15
- package/esm/FunnelChart/positionGetter.d.ts +1 -0
- package/esm/FunnelChart/positionGetter.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.js +1 -3
- package/esm/Heatmap/Heatmap.d.ts +8 -3
- package/esm/Heatmap/Heatmap.js +10 -2
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.d.ts +3 -2
- package/esm/LineChartPro/LineChartPro.js +1 -1
- package/esm/PieChartPro/PieChartPro.d.ts +22 -0
- package/esm/PieChartPro/PieChartPro.js +197 -0
- package/esm/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/esm/PieChartPro/PieChartPro.plugins.js +3 -0
- package/esm/PieChartPro/index.d.ts +1 -0
- package/esm/PieChartPro/index.js +1 -0
- package/esm/RadarChartPro/RadarChartPro.d.ts +17 -2
- package/esm/RadarChartPro/RadarChartPro.js +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +3 -2
- package/esm/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/package.json +7 -7
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createSelector, selectorChartSeriesConfig, selectorChartSeriesProcessed, selectorChartDrawingArea, selectorChartRawXAxis, selectorChartRawYAxis } from '@mui/x-charts/internals';
|
|
2
|
+
import { computeAxisValue } from "./computeAxisValue.js";
|
|
3
|
+
export const selectorFunnel = state => state.funnel;
|
|
4
|
+
export const selectorFunnelGap = createSelector([selectorFunnel], funnel => funnel?.gap ?? 0);
|
|
5
|
+
export const selectorChartXAxis = createSelector([selectorChartRawXAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorFunnelGap], (axis, drawingArea, formattedSeries, seriesConfig, gap) => computeAxisValue({
|
|
6
|
+
drawingArea,
|
|
7
|
+
formattedSeries,
|
|
8
|
+
axis,
|
|
9
|
+
seriesConfig,
|
|
10
|
+
axisDirection: 'x',
|
|
11
|
+
gap
|
|
12
|
+
}));
|
|
13
|
+
export const selectorChartYAxis = createSelector([selectorChartRawYAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorFunnelGap], (axis, drawingArea, formattedSeries, seriesConfig, gap) => computeAxisValue({
|
|
14
|
+
drawingArea,
|
|
15
|
+
formattedSeries,
|
|
16
|
+
axis,
|
|
17
|
+
seriesConfig,
|
|
18
|
+
axisDirection: 'y',
|
|
19
|
+
gap
|
|
20
|
+
}));
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { FunnelSectionProps } from "./FunnelSection.js";
|
|
3
|
+
import { FunnelSectionLabelProps } from "./FunnelSectionLabel.js";
|
|
3
4
|
export interface FunnelPlotSlots {
|
|
5
|
+
/**
|
|
6
|
+
* Custom component for funnel section.
|
|
7
|
+
* @default FunnelSection
|
|
8
|
+
*/
|
|
4
9
|
funnelSection?: React.ElementType<FunnelSectionProps>;
|
|
10
|
+
/**
|
|
11
|
+
* Custom component for funnel section label.
|
|
12
|
+
* @default FunnelSectionLabel
|
|
13
|
+
*/
|
|
14
|
+
funnelSectionLabel?: React.ElementType<FunnelSectionLabelProps>;
|
|
5
15
|
}
|
|
6
16
|
export interface FunnelPlotSlotProps {
|
|
7
17
|
funnelSection?: FunnelSectionProps;
|
|
18
|
+
funnelSectionLabel?: FunnelSectionLabelProps;
|
|
8
19
|
}
|
|
9
20
|
export interface FunnelPlotSlotExtension {
|
|
10
21
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FunnelSectionProps } from "./FunnelSection.js";
|
|
2
|
+
import type { FunnelSectionLabelProps } from "./FunnelSectionLabel.js";
|
|
2
3
|
export interface FunnelSectionClasses {
|
|
3
4
|
/** Styles applied to the root element. */
|
|
4
5
|
root: string;
|
|
@@ -19,4 +20,5 @@ export interface FunnelSectionClasses {
|
|
|
19
20
|
series: string;
|
|
20
21
|
}
|
|
21
22
|
export declare const useUtilityClasses: (props: FunnelSectionProps) => Record<"label" | "filled" | "outlined" | "highlighted" | "faded" | "root", string>;
|
|
23
|
+
export declare const useLabelUtilityClasses: (props: FunnelSectionLabelProps) => Record<"label", string>;
|
|
22
24
|
export declare const funnelSectionClasses: FunnelSectionClasses;
|
|
@@ -8,10 +8,11 @@ export const useUtilityClasses = props => {
|
|
|
8
8
|
const {
|
|
9
9
|
classes,
|
|
10
10
|
seriesId,
|
|
11
|
-
variant
|
|
11
|
+
variant,
|
|
12
|
+
dataIndex
|
|
12
13
|
} = props;
|
|
13
14
|
const slots = {
|
|
14
|
-
root: ['root', `series-${seriesId}`],
|
|
15
|
+
root: ['root', `series-${seriesId}`, `data-index-${dataIndex}`],
|
|
15
16
|
highlighted: ['highlighted'],
|
|
16
17
|
faded: ['faded'],
|
|
17
18
|
outlined: variant === 'outlined' ? ['outlined'] : [],
|
|
@@ -20,4 +21,15 @@ export const useUtilityClasses = props => {
|
|
|
20
21
|
};
|
|
21
22
|
return composeClasses(slots, getFunnelSectionUtilityClass, classes);
|
|
22
23
|
};
|
|
23
|
-
export const
|
|
24
|
+
export const useLabelUtilityClasses = props => {
|
|
25
|
+
const {
|
|
26
|
+
classes,
|
|
27
|
+
seriesId,
|
|
28
|
+
dataIndex
|
|
29
|
+
} = props;
|
|
30
|
+
const slots = {
|
|
31
|
+
label: ['label', `series-${seriesId}`, `data-index-${dataIndex}`]
|
|
32
|
+
};
|
|
33
|
+
return composeClasses(slots, getFunnelSectionUtilityClass, classes);
|
|
34
|
+
};
|
|
35
|
+
export const funnelSectionClasses = generateUtilityClasses('MuiFunnelSection', ['root', 'highlighted', 'faded', 'filled', 'outlined', 'label', 'series', 'data-index']);
|
|
@@ -6,4 +6,6 @@ export * from "./categoryAxis.types.js";
|
|
|
6
6
|
export * from "./funnelSlots.types.js";
|
|
7
7
|
export type { FunnelCurveType } from "./curves/index.js";
|
|
8
8
|
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
9
|
-
export type { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
9
|
+
export type { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
10
|
+
export { FunnelSection } from "./FunnelSection.js";
|
|
11
|
+
export { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
package/esm/FunnelChart/index.js
CHANGED
|
@@ -3,4 +3,6 @@ export * from "./FunnelPlot.js";
|
|
|
3
3
|
export * from "./funnel.types.js";
|
|
4
4
|
export * from "./categoryAxis.types.js";
|
|
5
5
|
export * from "./funnelSlots.types.js";
|
|
6
|
-
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
6
|
+
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
7
|
+
export { FunnelSection } from "./FunnelSection.js";
|
|
8
|
+
export { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FunnelDataPoints, FunnelLabelOptions } from "./funnel.types.js";
|
|
2
|
+
import { PositionGetter } from "./positionGetter.js";
|
|
2
3
|
/**
|
|
3
4
|
* It tries to keep the label inside the bounds of the section based on the position.
|
|
4
5
|
*
|
|
@@ -30,8 +31,8 @@ export declare const positionLabel: ({
|
|
|
30
31
|
dataIndex,
|
|
31
32
|
baseScaleData
|
|
32
33
|
}: Omit<FunnelLabelOptions, "textAnchor" | "dominantBaseline"> & {
|
|
33
|
-
xPosition:
|
|
34
|
-
yPosition:
|
|
34
|
+
xPosition: PositionGetter;
|
|
35
|
+
yPosition: PositionGetter;
|
|
35
36
|
isHorizontal: boolean;
|
|
36
37
|
values: readonly FunnelDataPoints[];
|
|
37
38
|
dataIndex: number;
|
|
@@ -73,28 +73,28 @@ export const positionLabel = ({
|
|
|
73
73
|
minBottom = yPosition(values[2].y, baseScaleData[dataIndex], stackOffset) + mv;
|
|
74
74
|
maxBottom = yPosition(values[3].y, baseScaleData[dataIndex], stackOffset) + mv;
|
|
75
75
|
minRight = 0;
|
|
76
|
-
maxRight = xPosition(Math.min(...values.map(v => v.x)), baseScaleData[dataIndex], stackOffset, true) + mh;
|
|
76
|
+
maxRight = xPosition(Math.min(...values.map(v => v.x)), dataIndex, baseScaleData[dataIndex], stackOffset, true) + mh;
|
|
77
77
|
minLeft = 0;
|
|
78
|
-
maxLeft = xPosition(Math.max(...values.map(v => v.x)), baseScaleData[dataIndex], stackOffset) + mh;
|
|
78
|
+
maxLeft = xPosition(Math.max(...values.map(v => v.x)), dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
|
|
79
79
|
center = maxRight - (maxRight - maxLeft) / 2;
|
|
80
80
|
leftCenter = 0;
|
|
81
81
|
rightCenter = 0;
|
|
82
|
-
middle = yPosition(0, baseScaleData[dataIndex], stackOffset) - mv;
|
|
83
|
-
topMiddle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, baseScaleData[dataIndex], stackOffset) - mv;
|
|
84
|
-
bottomMiddle = yPosition(values[3].y - (values[3].y - values[2].y) / 2, baseScaleData[dataIndex], stackOffset) + mv;
|
|
82
|
+
middle = yPosition(0, dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
|
|
83
|
+
topMiddle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
|
|
84
|
+
bottomMiddle = yPosition(values[3].y - (values[3].y - values[2].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) + mv;
|
|
85
85
|
} else {
|
|
86
86
|
minTop = 0;
|
|
87
|
-
maxTop = yPosition(Math.max(...values.map(v => v.y)), baseScaleData[dataIndex], stackOffset) - mv;
|
|
87
|
+
maxTop = yPosition(Math.max(...values.map(v => v.y)), dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
|
|
88
88
|
minBottom = 0;
|
|
89
|
-
maxBottom = yPosition(Math.min(...values.map(v => v.y)), baseScaleData[dataIndex], stackOffset, true) - mv;
|
|
90
|
-
maxRight = xPosition(values[0].x, baseScaleData[dataIndex], stackOffset) + mh;
|
|
91
|
-
minRight = xPosition(values[1].x, baseScaleData[dataIndex], stackOffset) + mh;
|
|
92
|
-
minLeft = xPosition(values[2].x, baseScaleData[dataIndex], stackOffset) - mh;
|
|
93
|
-
maxLeft = xPosition(values[3].x, baseScaleData[dataIndex], stackOffset) - mh;
|
|
94
|
-
center = xPosition(0, baseScaleData[dataIndex], stackOffset) - mh;
|
|
95
|
-
rightCenter = xPosition(values[0].x - (values[0].x - values[1].x) / 2, baseScaleData[dataIndex], stackOffset) + mh;
|
|
96
|
-
leftCenter = xPosition(values[3].x - (values[3].x - values[2].x) / 2, baseScaleData[dataIndex], stackOffset) - mh;
|
|
97
|
-
middle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, baseScaleData[dataIndex], stackOffset);
|
|
89
|
+
maxBottom = yPosition(Math.min(...values.map(v => v.y)), dataIndex, baseScaleData[dataIndex], stackOffset, true) - mv;
|
|
90
|
+
maxRight = xPosition(values[0].x, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
|
|
91
|
+
minRight = xPosition(values[1].x, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
|
|
92
|
+
minLeft = xPosition(values[2].x, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
|
|
93
|
+
maxLeft = xPosition(values[3].x, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
|
|
94
|
+
center = xPosition(0, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
|
|
95
|
+
rightCenter = xPosition(values[0].x - (values[0].x - values[1].x) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
|
|
96
|
+
leftCenter = xPosition(values[3].x - (values[3].x - values[2].x) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
|
|
97
|
+
middle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset);
|
|
98
98
|
middle = maxTop - (maxTop - maxBottom) / 2;
|
|
99
99
|
topMiddle = 0;
|
|
100
100
|
bottomMiddle = 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PositionGetter = (value: number, bandIndex: number, bandIdentifier: string | number, stackOffset?: number, useBand?: boolean) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -85,8 +85,7 @@ export const useFunnelChartProps = props => {
|
|
|
85
85
|
onHighlightChange,
|
|
86
86
|
className,
|
|
87
87
|
axisHighlight,
|
|
88
|
-
apiRef
|
|
89
|
-
gap
|
|
88
|
+
apiRef
|
|
90
89
|
} = props,
|
|
91
90
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
92
91
|
const margin = defaultizeMargin(marginProps, DEFAULT_MARGINS);
|
|
@@ -118,7 +117,6 @@ export const useFunnelChartProps = props => {
|
|
|
118
117
|
plugins: FUNNEL_CHART_PLUGINS
|
|
119
118
|
});
|
|
120
119
|
const funnelPlotProps = {
|
|
121
|
-
gap,
|
|
122
120
|
onItemClick,
|
|
123
121
|
slots,
|
|
124
122
|
slotProps
|
package/esm/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
|
5
5
|
import { ChartsAxisSlots, ChartsAxisSlotProps, XAxis, YAxis } from '@mui/x-charts/internals';
|
|
6
6
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
7
7
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
8
|
-
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
|
|
9
8
|
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
10
9
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
11
10
|
import { HeatmapSeriesType } from "../models/seriesType/heatmap.js";
|
|
12
11
|
import { HeatmapTooltipProps } from "./HeatmapTooltip/index.js";
|
|
13
12
|
import { HeatmapItemSlotProps, HeatmapItemSlots } from "./HeatmapItem.js";
|
|
14
13
|
import { HeatmapPluginsSignatures } from "./Heatmap.plugins.js";
|
|
15
|
-
|
|
14
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
15
|
+
export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, HeatmapItemSlots, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {
|
|
16
16
|
/**
|
|
17
17
|
* Custom component for the tooltip.
|
|
18
18
|
* @default ChartsTooltipRoot
|
|
@@ -24,7 +24,7 @@ export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, Heatm
|
|
|
24
24
|
*/
|
|
25
25
|
legend?: ChartsLegendSlots['legend'];
|
|
26
26
|
}
|
|
27
|
-
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps, ChartsLegendSlotProps,
|
|
27
|
+
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps, ChartsLegendSlotProps, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {
|
|
28
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
29
29
|
}
|
|
30
30
|
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
@@ -55,6 +55,11 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
55
55
|
* @default true
|
|
56
56
|
*/
|
|
57
57
|
hideLegend?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* If true, shows the default chart toolbar.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
showToolbar?: boolean;
|
|
58
63
|
/**
|
|
59
64
|
* Overridable component slots.
|
|
60
65
|
* @default {}
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -18,6 +18,7 @@ import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
|
18
18
|
import { HeatmapTooltip } from "./HeatmapTooltip/index.js";
|
|
19
19
|
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
20
20
|
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
21
|
+
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
21
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
23
24
|
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
@@ -58,7 +59,8 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
58
59
|
loading,
|
|
59
60
|
highlightedItem,
|
|
60
61
|
onHighlightChange,
|
|
61
|
-
hideLegend = true
|
|
62
|
+
hideLegend = true,
|
|
63
|
+
showToolbar = false
|
|
62
64
|
} = props;
|
|
63
65
|
const id = useId();
|
|
64
66
|
const clipPathId = `${id}-clip-path`;
|
|
@@ -92,6 +94,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
92
94
|
legendDirection: props.slotProps?.legend?.direction
|
|
93
95
|
};
|
|
94
96
|
const Tooltip = slots?.tooltip ?? HeatmapTooltip;
|
|
97
|
+
const Toolbar = slots?.toolbar ?? ChartsToolbarPro;
|
|
95
98
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, {
|
|
96
99
|
apiRef: apiRef,
|
|
97
100
|
seriesConfig: seriesConfig,
|
|
@@ -112,7 +115,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
112
115
|
onAxisClick: onAxisClick,
|
|
113
116
|
plugins: HEATMAP_PLUGINS,
|
|
114
117
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
115
|
-
children: [!hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
118
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
116
119
|
slots: _extends({}, slots, {
|
|
117
120
|
legend: slots?.legend ?? ContinuousColorLegend
|
|
118
121
|
}),
|
|
@@ -244,6 +247,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
244
247
|
* @ignore Unstable props for internal usage.
|
|
245
248
|
*/
|
|
246
249
|
seriesConfig: PropTypes.object,
|
|
250
|
+
/**
|
|
251
|
+
* If true, shows the default chart toolbar.
|
|
252
|
+
* @default false
|
|
253
|
+
*/
|
|
254
|
+
showToolbar: PropTypes.bool,
|
|
247
255
|
/**
|
|
248
256
|
* The props used for each component slot.
|
|
249
257
|
* @default {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @ignore - internal component.
|
|
3
3
|
*/
|
|
4
|
-
export declare const HeatmapTooltipAxesValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof import("react").ClassAttributes<HTMLElement> | keyof import("react").HTMLAttributes<HTMLElement>>, {}>;
|
|
4
|
+
export declare const HeatmapTooltipAxesValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof import("react").ClassAttributes<HTMLElement> | keyof import("react").HTMLAttributes<HTMLElement>>, {}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LineChartProps, LineChartSlots, LineChartSlotProps } from '@mui/x-charts/LineChart';
|
|
3
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
3
4
|
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
4
5
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
5
6
|
import { LineChartProPluginsSignatures } from "./LineChartPro.plugins.js";
|
|
6
|
-
export interface LineChartProSlots extends LineChartSlots, Partial<ChartsSlotsPro> {}
|
|
7
|
-
export interface LineChartProSlotProps extends LineChartSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
7
|
+
export interface LineChartProSlots extends Omit<LineChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
|
+
export interface LineChartProSlotProps extends Omit<LineChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
9
|
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|
|
@@ -75,7 +75,7 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
75
75
|
const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
|
|
76
76
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
77
77
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
78
|
-
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
78
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
79
79
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
80
80
|
children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
81
81
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx("g", {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PieChartProps, PieChartSlotProps, PieChartSlots } from '@mui/x-charts/PieChart';
|
|
3
|
+
import { ChartsSlotsPro, ChartsSlotPropsPro } from "../internals/material/index.js";
|
|
4
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
5
|
+
import { PieChartProPluginSignatures } from "./PieChartPro.plugins.js";
|
|
6
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
|
+
export interface PieChartProSlots extends Omit<PieChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
|
+
export interface PieChartProSlotProps extends Omit<PieChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
+
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
10
|
+
/**
|
|
11
|
+
* Overridable component slots.
|
|
12
|
+
* @default {}
|
|
13
|
+
*/
|
|
14
|
+
slots?: PieChartProSlots;
|
|
15
|
+
/**
|
|
16
|
+
* The props used for each component slot.
|
|
17
|
+
* @default {}
|
|
18
|
+
*/
|
|
19
|
+
slotProps?: PieChartProSlotProps;
|
|
20
|
+
}
|
|
21
|
+
declare const PieChartPro: React.ForwardRefExoticComponent<PieChartProProps & React.RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export { PieChartPro };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
4
|
+
import { ChartsWrapper, DEFAULT_PIE_CHART_MARGIN, defaultizeMargin } from '@mui/x-charts/internals';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
10
|
+
import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
11
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
12
|
+
import { PiePlot } from '@mui/x-charts/PieChart';
|
|
13
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
14
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
15
|
+
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
16
|
+
import { PIE_CHART_PRO_PLUGINS } from "./PieChartPro.plugins.js";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const PieChartPro = /*#__PURE__*/React.forwardRef(function PieChartPro(inProps, ref) {
|
|
19
|
+
const props = useThemeProps({
|
|
20
|
+
props: inProps,
|
|
21
|
+
name: 'MuiPieChartPro'
|
|
22
|
+
});
|
|
23
|
+
const {
|
|
24
|
+
series,
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
margin: marginProps,
|
|
28
|
+
colors,
|
|
29
|
+
sx,
|
|
30
|
+
skipAnimation,
|
|
31
|
+
hideLegend,
|
|
32
|
+
children,
|
|
33
|
+
slots,
|
|
34
|
+
slotProps,
|
|
35
|
+
onItemClick,
|
|
36
|
+
loading,
|
|
37
|
+
highlightedItem,
|
|
38
|
+
onHighlightChange,
|
|
39
|
+
className,
|
|
40
|
+
showToolbar
|
|
41
|
+
} = props,
|
|
42
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
43
|
+
const margin = defaultizeMargin(marginProps, DEFAULT_PIE_CHART_MARGIN);
|
|
44
|
+
const {
|
|
45
|
+
chartDataProviderProProps,
|
|
46
|
+
chartsSurfaceProps
|
|
47
|
+
} = useChartContainerProProps(_extends({}, other, {
|
|
48
|
+
series: series.map(s => _extends({
|
|
49
|
+
type: 'pie'
|
|
50
|
+
}, s)),
|
|
51
|
+
width,
|
|
52
|
+
height,
|
|
53
|
+
margin,
|
|
54
|
+
colors,
|
|
55
|
+
highlightedItem,
|
|
56
|
+
onHighlightChange,
|
|
57
|
+
className,
|
|
58
|
+
skipAnimation,
|
|
59
|
+
plugins: PIE_CHART_PRO_PLUGINS
|
|
60
|
+
}), ref);
|
|
61
|
+
const Tooltip = slots?.tooltip ?? ChartsTooltip;
|
|
62
|
+
const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
|
|
63
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
64
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, {
|
|
65
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
66
|
+
legendDirection: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
67
|
+
sx: sx,
|
|
68
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
69
|
+
direction: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
70
|
+
slots: slots,
|
|
71
|
+
slotProps: slotProps
|
|
72
|
+
}), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
73
|
+
children: [/*#__PURE__*/_jsx(PiePlot, {
|
|
74
|
+
slots: slots,
|
|
75
|
+
slotProps: slotProps,
|
|
76
|
+
onItemClick: onItemClick
|
|
77
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
78
|
+
loading: loading,
|
|
79
|
+
slots: slots,
|
|
80
|
+
slotProps: slotProps
|
|
81
|
+
}), children]
|
|
82
|
+
})), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
83
|
+
trigger: "item"
|
|
84
|
+
}, slotProps?.tooltip))]
|
|
85
|
+
})
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
88
|
+
if (process.env.NODE_ENV !== "production") PieChartPro.displayName = "PieChartPro";
|
|
89
|
+
process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
90
|
+
// ----------------------------- Warning --------------------------------
|
|
91
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
92
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
93
|
+
// ----------------------------------------------------------------------
|
|
94
|
+
apiRef: PropTypes.shape({
|
|
95
|
+
current: PropTypes.shape({
|
|
96
|
+
exportAsImage: PropTypes.func.isRequired,
|
|
97
|
+
exportAsPrint: PropTypes.func.isRequired
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
children: PropTypes.node,
|
|
101
|
+
className: PropTypes.string,
|
|
102
|
+
/**
|
|
103
|
+
* Color palette used to colorize multiple series.
|
|
104
|
+
* @default rainbowSurgePalette
|
|
105
|
+
*/
|
|
106
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
107
|
+
/**
|
|
108
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
109
|
+
*/
|
|
110
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
111
|
+
desc: PropTypes.string,
|
|
112
|
+
/**
|
|
113
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
114
|
+
*/
|
|
115
|
+
height: PropTypes.number,
|
|
116
|
+
/**
|
|
117
|
+
* If `true`, the legend is not rendered.
|
|
118
|
+
*/
|
|
119
|
+
hideLegend: PropTypes.bool,
|
|
120
|
+
/**
|
|
121
|
+
* The highlighted item.
|
|
122
|
+
* Used when the highlight is controlled.
|
|
123
|
+
*/
|
|
124
|
+
highlightedItem: PropTypes.shape({
|
|
125
|
+
dataIndex: PropTypes.number,
|
|
126
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
127
|
+
}),
|
|
128
|
+
/**
|
|
129
|
+
* This prop is used to help implement the accessibility logic.
|
|
130
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
131
|
+
*/
|
|
132
|
+
id: PropTypes.string,
|
|
133
|
+
/**
|
|
134
|
+
* If `true`, a loading overlay is displayed.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
loading: PropTypes.bool,
|
|
138
|
+
/**
|
|
139
|
+
* Localized text for chart components.
|
|
140
|
+
*/
|
|
141
|
+
localeText: PropTypes.object,
|
|
142
|
+
/**
|
|
143
|
+
* The margin between the SVG and the drawing area.
|
|
144
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
145
|
+
*
|
|
146
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
147
|
+
*/
|
|
148
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
149
|
+
bottom: PropTypes.number,
|
|
150
|
+
left: PropTypes.number,
|
|
151
|
+
right: PropTypes.number,
|
|
152
|
+
top: PropTypes.number
|
|
153
|
+
})]),
|
|
154
|
+
/**
|
|
155
|
+
* The callback fired when the highlighted item changes.
|
|
156
|
+
*
|
|
157
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
158
|
+
*/
|
|
159
|
+
onHighlightChange: PropTypes.func,
|
|
160
|
+
/**
|
|
161
|
+
* Callback fired when a pie arc is clicked.
|
|
162
|
+
*/
|
|
163
|
+
onItemClick: PropTypes.func,
|
|
164
|
+
/**
|
|
165
|
+
* The series to display in the pie chart.
|
|
166
|
+
* An array of [[PieSeriesType]] objects.
|
|
167
|
+
*/
|
|
168
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
169
|
+
/**
|
|
170
|
+
* If true, shows the default chart toolbar.
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
173
|
+
showToolbar: PropTypes.bool,
|
|
174
|
+
/**
|
|
175
|
+
* If `true`, animations are skipped.
|
|
176
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
177
|
+
*/
|
|
178
|
+
skipAnimation: PropTypes.bool,
|
|
179
|
+
/**
|
|
180
|
+
* The props used for each component slot.
|
|
181
|
+
* @default {}
|
|
182
|
+
*/
|
|
183
|
+
slotProps: PropTypes.object,
|
|
184
|
+
/**
|
|
185
|
+
* Overridable component slots.
|
|
186
|
+
* @default {}
|
|
187
|
+
*/
|
|
188
|
+
slots: PropTypes.object,
|
|
189
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
190
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
191
|
+
title: PropTypes.string,
|
|
192
|
+
/**
|
|
193
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
194
|
+
*/
|
|
195
|
+
width: PropTypes.number
|
|
196
|
+
} : void 0;
|
|
197
|
+
export { PieChartPro };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export type PieChartProPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
|
+
export declare const PIE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<PieChartProPluginSignatures>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PieChartPro.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PieChartPro.js";
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RadarChartProps, RadarDataProviderProps } from '@mui/x-charts/RadarChart';
|
|
2
|
+
import { RadarChartProps, RadarDataProviderProps, RadarChartSlotProps, RadarChartSlots } from '@mui/x-charts/RadarChart';
|
|
3
3
|
import { RadarChartProPluginsSignatures } from "./RadarChartPro.plugins.js";
|
|
4
|
-
|
|
4
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
5
|
+
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
6
|
+
export interface RadarChartProSlots extends Omit<RadarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
7
|
+
export interface RadarChartProSlotProps extends Omit<RadarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
+
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<RadarDataProviderProps<RadarChartProPluginsSignatures>, 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
9
|
+
/**
|
|
10
|
+
* Overridable component slots.
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
13
|
+
slots?: RadarChartProSlots;
|
|
14
|
+
/**
|
|
15
|
+
* The props used for each component slot.
|
|
16
|
+
* @default {}
|
|
17
|
+
*/
|
|
18
|
+
slotProps?: RadarChartProSlotProps;
|
|
19
|
+
}
|
|
5
20
|
/**
|
|
6
21
|
* Demos:
|
|
7
22
|
*
|
|
@@ -43,7 +43,7 @@ const RadarChartPro = /*#__PURE__*/React.forwardRef(function RadarChartPro(inPro
|
|
|
43
43
|
});
|
|
44
44
|
return /*#__PURE__*/_jsx(RadarDataProvider, _extends({}, radarDataProviderProProps, {
|
|
45
45
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
46
|
-
children: [props.showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
46
|
+
children: [props.showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
47
47
|
ref: ref,
|
|
48
48
|
children: [/*#__PURE__*/_jsx(RadarGrid, _extends({}, radarGrid)), /*#__PURE__*/_jsx(RadarMetricLabels, {}), /*#__PURE__*/_jsx(RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/_jsx(RadarAxisHighlight, {}), /*#__PURE__*/_jsx(RadarSeriesMarks, {}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), children]
|
|
49
49
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
@@ -3,8 +3,9 @@ import { ScatterChartProps, ScatterChartSlotProps, ScatterChartSlots } from '@mu
|
|
|
3
3
|
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
4
4
|
import { ChartContainerProProps } from "../ChartContainerPro/ChartContainerPro.js";
|
|
5
5
|
import { ScatterChartProPluginsSignatures } from "./ScatterChartPro.plugins.js";
|
|
6
|
-
|
|
7
|
-
export interface
|
|
6
|
+
import { ChartsToolbarProSlots, ChartsToolbarProSlotProps } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
|
+
export interface ScatterChartProSlots extends Omit<ScatterChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
|
+
export interface ScatterChartProSlotProps extends Omit<ScatterChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
9
|
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'onItemClick' | 'slots' | 'slotProps'> {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|
|
@@ -69,7 +69,7 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
69
69
|
const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
|
|
70
70
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
71
71
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
72
|
-
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
72
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
73
73
|
children: [/*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
74
74
|
"data-drawing-container": true,
|
|
75
75
|
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
package/esm/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./ChartDataProviderPro/index.js";
|
|
|
33
33
|
export * from "./ScatterChartPro/index.js";
|
|
34
34
|
export * from "./BarChartPro/index.js";
|
|
35
35
|
export * from "./LineChartPro/index.js";
|
|
36
|
+
export * from "./PieChartPro/index.js";
|
|
36
37
|
export * from "./FunnelChart/index.js";
|
|
37
38
|
export * from "./RadarChartPro/index.js";
|
|
38
39
|
export * from "./ChartZoomSlider/index.js";
|