@mui/x-charts 7.7.1 → 7.8.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/BarChart/BarElement.d.ts +225 -228
- package/BarChart/BarLabel/BarLabel.d.ts +225 -228
- package/BarChart/BarLabel/getBarLabel.d.ts +1 -1
- package/BarChart/useBarChartProps.d.ts +20 -88
- package/CHANGELOG.md +100 -1
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/useChartContainerHooks.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/ChartsReferenceLine/common.d.ts +0 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/LineChart/AnimatedArea.d.ts +225 -228
- package/LineChart/AnimatedLine.d.ts +225 -228
- package/LineChart/useLineChartProps.d.ts +26 -103
- package/LineChart/useLineChartProps.js +3 -3
- package/PieChart/PieArc.d.ts +0 -1
- package/PieChart/PieArcLabel.d.ts +0 -1
- package/PieChart/dataTransform/transition.d.ts +0 -1
- package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -2
- package/ScatterChart/useScatterChartProps.d.ts +20 -75
- package/context/CartesianProvider/computeValue.js +15 -0
- package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
- package/esm/BarChart/useBarChartProps.js +0 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +3 -1
- package/esm/LineChart/useLineChartProps.js +3 -3
- package/esm/context/CartesianProvider/computeValue.js +16 -1
- package/esm/hooks/useAxisEvents.js +5 -8
- package/esm/hooks/useScale.js +1 -1
- package/esm/hooks/useTicks.js +2 -1
- package/esm/internals/getSVGPoint.js +11 -0
- package/esm/internals/index.js +2 -0
- package/esm/internals/utils.js +0 -12
- package/hooks/useAxisEvents.js +6 -9
- package/hooks/useChartDimensions.d.ts +1 -1
- package/hooks/useColor.d.ts +1 -1
- package/hooks/useScale.js +1 -1
- package/hooks/useTicks.js +2 -1
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +68 -68
- package/internals/getSVGPoint.d.ts +6 -0
- package/internals/getSVGPoint.js +17 -0
- package/internals/getWordsByLines.d.ts +0 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +20 -0
- package/internals/useAnimatedPath.d.ts +0 -1
- package/internals/utils.d.ts +0 -6
- package/internals/utils.js +0 -13
- package/models/axis.d.ts +1 -2
- package/modern/BarChart/useBarChartProps.js +0 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +3 -1
- package/modern/LineChart/useLineChartProps.js +3 -3
- package/modern/context/CartesianProvider/computeValue.js +16 -1
- package/modern/hooks/useAxisEvents.js +5 -8
- package/modern/hooks/useScale.js +1 -1
- package/modern/hooks/useTicks.js +2 -1
- package/modern/index.js +1 -1
- package/modern/internals/getSVGPoint.js +11 -0
- package/modern/internals/index.js +2 -0
- package/modern/internals/utils.js +0 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SeriesId } from '../../models/seriesType/common';
|
|
2
2
|
import { BarLabelFunction } from './BarLabel.types';
|
|
3
3
|
export declare const getBarLabel: (options: {
|
|
4
|
-
barLabel:
|
|
4
|
+
barLabel: "value" | BarLabelFunction;
|
|
5
5
|
value: number | null;
|
|
6
6
|
dataIndex: number;
|
|
7
7
|
seriesId: SeriesId;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { BarChartProps } from './BarChart';
|
|
2
|
+
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
3
|
+
import { BarPlotProps } from './BarPlot';
|
|
4
|
+
import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
|
|
5
|
+
import { ChartsGridProps } from '../ChartsGrid';
|
|
6
|
+
import { ChartsClipPathProps } from '../ChartsClipPath';
|
|
7
|
+
import { ChartsOverlayProps } from '../ChartsOverlay';
|
|
8
|
+
import { ChartsAxisProps } from '../ChartsAxis';
|
|
9
|
+
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
|
+
import { ChartsLegendProps } from '../ChartsLegend';
|
|
11
|
+
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
3
12
|
/**
|
|
4
13
|
* A helper function that extracts BarChartProps from the input props
|
|
5
14
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -8,95 +17,18 @@ import type { BarChartProps } from './BarChart';
|
|
|
8
17
|
* @returns An object with props for the children components of BarChart
|
|
9
18
|
*/
|
|
10
19
|
export declare const useBarChartProps: (props: BarChartProps) => {
|
|
11
|
-
chartContainerProps:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
17
|
-
id?: import("../internals").SeriesId | undefined;
|
|
18
|
-
dataKey?: string | undefined;
|
|
19
|
-
stackOffset?: import("..").StackOffsetType | undefined;
|
|
20
|
-
valueFormatter?: import("../internals").SeriesValueFormatter<number | null> | undefined;
|
|
21
|
-
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
22
|
-
xAxisKey?: string | undefined;
|
|
23
|
-
yAxisKey?: string | undefined;
|
|
24
|
-
stack?: string | undefined;
|
|
25
|
-
stackOrder?: import("..").StackOrderType | undefined;
|
|
26
|
-
type: "bar";
|
|
27
|
-
}[];
|
|
28
|
-
width: number | undefined;
|
|
29
|
-
height: number | undefined;
|
|
30
|
-
margin: Partial<import("..").CardinalDirections<number>> | undefined;
|
|
31
|
-
colors: import("..").ChartsColorPalette | undefined;
|
|
32
|
-
dataset: import("../internals").DatasetType | undefined;
|
|
33
|
-
xAxis: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsXAxisProps>, "id">[] | undefined;
|
|
34
|
-
yAxis: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsYAxisProps>, "id">[] | undefined;
|
|
35
|
-
sx: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
36
|
-
highlightedItem: import("..").HighlightItemData | null | undefined;
|
|
37
|
-
onHighlightChange: ((highlightedItem: import("..").HighlightItemData | null) => void) | undefined;
|
|
38
|
-
disableAxisListener: boolean;
|
|
39
|
-
};
|
|
40
|
-
barPlotProps: {
|
|
41
|
-
onItemClick: ((event: import("react").MouseEvent<SVGElement, MouseEvent>, barItemIdentifier: import("..").BarItemIdentifier) => void) | undefined;
|
|
42
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
43
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
44
|
-
skipAnimation: boolean | undefined;
|
|
45
|
-
borderRadius: number | undefined;
|
|
46
|
-
barLabel: "value" | ((item: import("./BarLabel").BarItem, context: import("./BarLabel").BarLabelContext) => string | null | undefined) | undefined;
|
|
47
|
-
};
|
|
48
|
-
axisClickHandlerProps: {
|
|
49
|
-
onAxisClick: ((event: MouseEvent, data: {
|
|
50
|
-
dataIndex: number;
|
|
51
|
-
axisValue?: string | number | Date | undefined;
|
|
52
|
-
seriesValues: Record<string, number | null | undefined>;
|
|
53
|
-
} | null) => void) | undefined;
|
|
54
|
-
};
|
|
55
|
-
gridProps: {
|
|
56
|
-
vertical: boolean | undefined;
|
|
57
|
-
horizontal: boolean | undefined;
|
|
58
|
-
};
|
|
59
|
-
clipPathProps: {
|
|
60
|
-
id: string;
|
|
61
|
-
};
|
|
20
|
+
chartContainerProps: ResponsiveChartContainerProps;
|
|
21
|
+
barPlotProps: BarPlotProps;
|
|
22
|
+
axisClickHandlerProps: ChartsOnAxisClickHandlerProps;
|
|
23
|
+
gridProps: ChartsGridProps;
|
|
24
|
+
clipPathProps: ChartsClipPathProps;
|
|
62
25
|
clipPathGroupProps: {
|
|
63
26
|
clipPath: string;
|
|
64
27
|
};
|
|
65
|
-
overlayProps:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
chartsAxisProps: {
|
|
71
|
-
topAxis: string | import("..").ChartsXAxisProps | null | undefined;
|
|
72
|
-
leftAxis: string | import("..").ChartsYAxisProps | null | undefined;
|
|
73
|
-
rightAxis: string | import("..").ChartsYAxisProps | null | undefined;
|
|
74
|
-
bottomAxis: string | import("..").ChartsXAxisProps | null | undefined;
|
|
75
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
76
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
77
|
-
};
|
|
78
|
-
axisHighlightProps: {
|
|
79
|
-
x?: ("none" | "line" | "band") | undefined;
|
|
80
|
-
y: "none" | "line" | "band";
|
|
81
|
-
} | {
|
|
82
|
-
x: "none" | "line" | "band";
|
|
83
|
-
y?: ("none" | "line" | "band") | undefined;
|
|
84
|
-
};
|
|
85
|
-
legendProps: {
|
|
86
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
87
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
88
|
-
position?: import("..").AnchorPosition | undefined;
|
|
89
|
-
classes?: Partial<import("..").ChartsLegendClasses> | undefined;
|
|
90
|
-
hidden?: boolean | undefined;
|
|
91
|
-
direction?: import("..").Direction | undefined;
|
|
92
|
-
};
|
|
93
|
-
tooltipProps: {
|
|
94
|
-
slots: import("./BarChart").BarChartSlots | undefined;
|
|
95
|
-
slotProps: import("./BarChart").BarChartSlotProps | undefined;
|
|
96
|
-
trigger?: import("../ChartsTooltip/utils").TriggerOptions | undefined;
|
|
97
|
-
itemContent?: import("react").ElementType<import("..").ChartsItemContentProps<any>, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
98
|
-
axisContent?: import("react").ElementType<import("..").ChartsAxisContentProps, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
99
|
-
classes?: Partial<import("..").ChartsTooltipClasses> | undefined;
|
|
100
|
-
};
|
|
28
|
+
overlayProps: ChartsOverlayProps;
|
|
29
|
+
chartsAxisProps: ChartsAxisProps;
|
|
30
|
+
axisHighlightProps: ChartsAxisHighlightProps;
|
|
31
|
+
legendProps: ChartsLegendProps;
|
|
32
|
+
tooltipProps: ChartsTooltipProps;
|
|
101
33
|
children: import("react").ReactNode;
|
|
102
34
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,105 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.8.0
|
|
7
|
+
|
|
8
|
+
_Jun 28, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🛰 Introduce server-side data source for improved server integration in the Data Grid.
|
|
13
|
+
|
|
14
|
+
Supports server-side pagination, sorting and filtering on plain and tree data, and automatic caching.
|
|
15
|
+
|
|
16
|
+
To enable, provide a `getRows` function to the `unstable_dataSource` prop on the Data Grid component.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
const dataSource = {
|
|
20
|
+
getRows: async (params: GridServerGetRowsParams) => {
|
|
21
|
+
const data = await fetch(
|
|
22
|
+
`https://api.example.com/data?${new URLSearchParams({
|
|
23
|
+
page: params.page,
|
|
24
|
+
pageSize: params.pageSize,
|
|
25
|
+
sortModel: JSON.stringify(params.sortModel),
|
|
26
|
+
filterModel: JSON.stringify(params.filterModel),
|
|
27
|
+
}).toString()}`,
|
|
28
|
+
);
|
|
29
|
+
return {
|
|
30
|
+
rows: data.rows,
|
|
31
|
+
totalRows: data.totalRows,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
<DataGridPro
|
|
36
|
+
unstable_dataSource={dataSource}
|
|
37
|
+
{...otherProps}
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
See [server-side data documentation](https://mui.com/x/react-data-grid/server-side-data/) for more details.
|
|
42
|
+
|
|
43
|
+
- 📈 Support Date data on the BarChart component
|
|
44
|
+
- ↕️ Support custom column sort icons on the Data Grid
|
|
45
|
+
- 🖱️ Support modifying the expansion trigger on the Tree View components
|
|
46
|
+
|
|
47
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
48
|
+
|
|
49
|
+
### Data Grid
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-data-grid@7.8.0`
|
|
52
|
+
|
|
53
|
+
- [DataGrid] Add `columnHeaderSortIcon` slot (#13563) @arminmeh
|
|
54
|
+
- [DataGrid] Fix dimensions lag issue after autosize (#13587) @MBilalShafi
|
|
55
|
+
- [DataGrid] Fix print export failure when `hideFooter` option is set (#13034) @tarunrajput
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-data-grid-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
58
|
+
|
|
59
|
+
Same changes as in `@mui/x-data-grid@7.8.0`, plus:
|
|
60
|
+
|
|
61
|
+
- [DataGridPro] Fix multi-sorting indicator being cut off (#13625) @KenanYusuf
|
|
62
|
+
- [DataGridPro] Server-side tree data support (#12317) @MBilalShafi
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-data-grid-premium@7.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-data-grid-pro@7.8.0`.
|
|
67
|
+
|
|
68
|
+
### Date and Time Pickers
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-date-pickers@7.8.0`
|
|
71
|
+
|
|
72
|
+
- [fields] Fix section clearing behavior on Android (#13652) @LukasTy
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-date-pickers-pro@7.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
75
|
+
|
|
76
|
+
Same changes as in `@mui/x-date-pickers@7.8.0`.
|
|
77
|
+
|
|
78
|
+
### Charts
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-charts@7.8.0`
|
|
81
|
+
|
|
82
|
+
- [charts] Fix line chart props not passing correct event handlers (#13609) @JCQuintas
|
|
83
|
+
- [charts] Support BarChart with `Date` data (#13471) @alexfauquette
|
|
84
|
+
- [charts] Support RTL for y-axis (#13614) @alexfauquette
|
|
85
|
+
- [charts] Use default values instead of non-null assertion to prevent error being thrown (#13637) @JCQuintas
|
|
86
|
+
|
|
87
|
+
### Tree View
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@7.8.0`
|
|
90
|
+
|
|
91
|
+
- [TreeView] Add `expansionTrigger` prop (#13533) @noraleonte
|
|
92
|
+
- [TreeView] Support experimental features from plugin's dependencies (#13632) @flaviendelangle
|
|
93
|
+
|
|
94
|
+
### Docs
|
|
95
|
+
|
|
96
|
+
- [docs] Add callout for `Luxon` `throwOnInvalid` support (#13621) @LukasTy
|
|
97
|
+
- [docs] Add "Overlays" section to the Data Grid documentation (#13624) @KenanYusuf
|
|
98
|
+
|
|
99
|
+
### Core
|
|
100
|
+
|
|
101
|
+
- [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
|
|
102
|
+
- [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
|
|
103
|
+
- [license] Allow usage of charts and tree view pro package for old premium licenses (#13619) @flaviendelangle
|
|
104
|
+
|
|
6
105
|
## 7.7.1
|
|
7
106
|
|
|
8
107
|
_Jun 21, 2024_
|
|
@@ -44,7 +143,7 @@ Same changes as in `@mui/x-data-grid-pro@7.7.1`.
|
|
|
44
143
|
- [pickers] Always use the same timezone in the field, the view and the layout components (#13481) @flaviendelangle
|
|
45
144
|
- [pickers] Fix `AdapterDateFnsV3` generated method types (#13464) @alexey-kozlenkov
|
|
46
145
|
- [pickers] Fix controlled `view` behavior (#13552) @LukasTy
|
|
47
|
-
- [TimePicker] Improves RTL verification for the time pickers default views
|
|
146
|
+
- [TimePicker] Improves RTL verification for the time pickers default views (#13447) @arthurbalduini
|
|
48
147
|
|
|
49
148
|
#### `@mui/x-date-pickers-pro@7.7.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
149
|
|
|
@@ -20,6 +20,6 @@ declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurface
|
|
|
20
20
|
* An array of plugins defining how to preprocess data.
|
|
21
21
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
22
22
|
*/
|
|
23
|
-
plugins?: ChartsPluginType<
|
|
23
|
+
plugins?: ChartsPluginType<ChartSeriesType>[];
|
|
24
24
|
} & React.RefAttributes<unknown>>;
|
|
25
25
|
export { ChartContainer };
|
|
@@ -3,7 +3,7 @@ import { ChartsPluginType } from '../models';
|
|
|
3
3
|
import { ChartSeriesType } from '../models/seriesType/config';
|
|
4
4
|
export declare const useChartContainerHooks: (ref: React.ForwardedRef<unknown> | null, plugins?: ChartsPluginType<ChartSeriesType>[]) => {
|
|
5
5
|
svgRef: React.RefObject<SVGSVGElement>;
|
|
6
|
-
handleRef: ((instance: unknown) => void) | null;
|
|
6
|
+
handleRef: ((instance: unknown) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
|
|
7
7
|
xExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
8
8
|
yExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
9
9
|
seriesFormatters: import("../internals").SeriesFormatterConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
@@ -77,15 +77,30 @@ function ChartsAxisHighlight(props) {
|
|
|
77
77
|
} = React.useContext(_InteractionProvider.InteractionContext);
|
|
78
78
|
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
79
79
|
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
80
|
+
const axisX = axis.x;
|
|
81
|
+
const axisY = axis.y;
|
|
82
|
+
const isBandScaleX = xAxisHighlight === 'band' && axisX !== null && (0, _isBandScale.isBandScale)(xScale);
|
|
83
|
+
const isBandScaleY = yAxisHighlight === 'band' && axisY !== null && (0, _isBandScale.isBandScale)(yScale);
|
|
84
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
85
|
+
const isXError = isBandScaleX && xScale(axisX.value) === undefined;
|
|
86
|
+
const isYError = isBandScaleY && yScale(axisY.value) === undefined;
|
|
87
|
+
if (isXError || isYError) {
|
|
88
|
+
console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
80
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
81
|
-
children: [
|
|
82
|
-
|
|
92
|
+
children: [isBandScaleX && xScale(axisX.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath
|
|
93
|
+
// @ts-expect-error, xScale value is checked in the statement above
|
|
94
|
+
, {
|
|
95
|
+
d: `M ${xScale(axisX.value) - (xScale.step() - xScale.bandwidth()) / 2} ${yScale.range()[0]} l ${xScale.step()} 0 l 0 ${yScale.range()[1] - yScale.range()[0]} l ${-xScale.step()} 0 Z`,
|
|
83
96
|
className: classes.root,
|
|
84
97
|
ownerState: {
|
|
85
98
|
axisHighlight: 'band'
|
|
86
99
|
}
|
|
87
|
-
}),
|
|
88
|
-
d: `M ${xScale.range()[0]} ${
|
|
100
|
+
}), isBandScaleY && yScale(axisY.value) === undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
101
|
+
d: `M ${xScale.range()[0]} ${
|
|
102
|
+
// @ts-expect-error, yScale value is checked in the statement above
|
|
103
|
+
yScale(axisY.value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${xScale.range()[1] - xScale.range()[0]} 0 l 0 ${-yScale.step()} Z`,
|
|
89
104
|
className: classes.root,
|
|
90
105
|
ownerState: {
|
|
91
106
|
axisHighlight: 'band'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const ChartsTooltipPaper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
|
|
3
2
|
export declare const ChartsTooltipTable: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, keyof import("react").ClassAttributes<HTMLTableElement> | keyof import("react").TableHTMLAttributes<HTMLTableElement>>, {}>;
|
|
4
3
|
export declare const ChartsTooltipRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, keyof import("react").ClassAttributes<HTMLTableRowElement> | keyof import("react").HTMLAttributes<HTMLTableRowElement>>, {}>;
|
|
@@ -12,7 +12,7 @@ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedE
|
|
|
12
12
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
13
13
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
14
14
|
var _useScale = require("../hooks/useScale");
|
|
15
|
-
var
|
|
15
|
+
var _getSVGPoint = require("../internals/getSVGPoint");
|
|
16
16
|
var _hooks = require("../hooks");
|
|
17
17
|
var _context = require("../context");
|
|
18
18
|
var _useSeries = require("../hooks/useSeries");
|
|
@@ -105,7 +105,7 @@ function ChartsVoronoiHandler(props) {
|
|
|
105
105
|
// TODO: A perf optimisation of voronoi could be to use the last point as the initial point for the next search.
|
|
106
106
|
function getClosestPoint(event) {
|
|
107
107
|
// Get mouse coordinate in global SVG space
|
|
108
|
-
const svgPoint = (0,
|
|
108
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(svgRef.current, event);
|
|
109
109
|
const outsideX = svgPoint.x < left || svgPoint.x > left + width;
|
|
110
110
|
const outsideY = svgPoint.y < top || svgPoint.y > top + height;
|
|
111
111
|
if (outsideX || outsideY) {
|
|
@@ -90,6 +90,7 @@ function ChartsYAxis(inProps) {
|
|
|
90
90
|
tickLabelInterval
|
|
91
91
|
} = defaultizedProps;
|
|
92
92
|
const theme = (0, _styles.useTheme)();
|
|
93
|
+
const isRTL = theme.direction === 'rtl';
|
|
93
94
|
const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
|
|
94
95
|
theme
|
|
95
96
|
}));
|
|
@@ -117,13 +118,14 @@ function ChartsYAxis(inProps) {
|
|
|
117
118
|
const Tick = slots?.axisTick ?? 'line';
|
|
118
119
|
const TickLabel = slots?.axisTickLabel ?? _ChartsText.ChartsText;
|
|
119
120
|
const Label = slots?.axisLabel ?? _ChartsText.ChartsText;
|
|
121
|
+
const revertAnchor = !isRTL && position === 'right' || isRTL && position !== 'right';
|
|
120
122
|
const axisTickLabelProps = (0, _utils.useSlotProps)({
|
|
121
123
|
elementType: TickLabel,
|
|
122
124
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
123
125
|
additionalProps: {
|
|
124
126
|
style: (0, _extends2.default)({
|
|
125
127
|
fontSize: tickFontSize,
|
|
126
|
-
textAnchor:
|
|
128
|
+
textAnchor: revertAnchor ? 'start' : 'end',
|
|
127
129
|
dominantBaseline: 'central'
|
|
128
130
|
}, tickLabelStyle)
|
|
129
131
|
},
|
package/Gauge/GaugeProvider.d.ts
CHANGED