-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[charts] Fix zoom option reactivity (mui#16262)
- Loading branch information
1 parent
e0e7466
commit de8366b
Showing
7 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/x-charts-pro/src/internals/plugins/useChartProZoom/creatZoomLookup.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { AxisId, DefaultizedZoomOptions } from '@mui/x-charts/internals'; | ||
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '@mui/x-charts/models'; | ||
import { defaultizeZoom } from './defaultizeZoom'; | ||
|
||
export const creatZoomLookup = ( | ||
axes: AxisConfig<ScaleName, any, ChartsXAxisProps | ChartsYAxisProps>[], | ||
) => | ||
axes.reduce<Record<AxisId, DefaultizedZoomOptions>>((acc, v) => { | ||
const { zoom, id: axisId } = v; | ||
const defaultizedZoom = defaultizeZoom(zoom, axisId, 'x'); | ||
if (defaultizedZoom) { | ||
acc[axisId] = defaultizedZoom; | ||
} | ||
return acc; | ||
}, {}); |
16 changes: 13 additions & 3 deletions
16
packages/x-charts-pro/src/internals/plugins/useChartProZoom/useChartProZoom.selectors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/x-charts/src/internals/plugins/featurePlugins/useChartCartesianAxis/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { useChartCartesianAxis } from './useChartCartesianAxis'; | ||
export type * from './useChartCartesianAxis.types'; | ||
export * from './useChartCartesianAxis.selectors'; | ||
export { defaultizeAxis } from './defaultizeAxis'; | ||
export * from './computeAxisValue'; | ||
export * from './zoom.types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters