Skip to content

Commit

Permalink
[charts] Fix internal typo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Feb 10, 2025
1 parent 04c75a5 commit 0028706
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getSVGPoint,
selectorChartDrawingArea,
ZoomData,
creatZoomLookup,
createZoomLookup,
selectorChartZoomOptionsLookup,
} from '@mui/x-charts/internals';
import { UseChartProZoomSignature } from './useChartProZoom.types';
Expand Down Expand Up @@ -379,8 +379,8 @@ useChartProZoom.getDefaultizedParams = ({ params }) => {

useChartProZoom.getInitialState = (params) => {
const optionsLookup = {
...creatZoomLookup('x')(params.defaultizedXAxis),
...creatZoomLookup('y')(params.defaultizedYAxis),
...createZoomLookup('x')(params.defaultizedXAxis),
...createZoomLookup('y')(params.defaultizedYAxis),
};
return {
zoom: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AxisId } from '../../../../models/axis';
import { defaultizeZoom } from './defaultizeZoom';
import { DefaultizedZoomOptions } from './useChartCartesianAxis.types';

export const creatZoomLookup =
export const createZoomLookup =
(axisDirection: 'x' | 'y') =>
(axes: AxisConfig<ScaleName, any, ChartsXAxisProps | ChartsYAxisProps>[] = []) =>
axes.reduce<Record<AxisId, DefaultizedZoomOptions>>((acc, v) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export type * from './useChartCartesianAxis.types';
export * from './useChartCartesianAxis.selectors';
export { defaultizeAxis } from './defaultizeAxis';
export * from './computeAxisValue';
export * from './creatZoomLookup';
export * from './createZoomLookup';
export * from './zoom.types';
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UseChartCartesianAxisSignature } from './useChartCartesianAxis.types';
import { ChartState } from '../../models/chart';
import { createAxisFilterMapper, createGetAxisFilters } from './createAxisFilterMapper';
import { ZoomAxisFilters, ZoomData } from './zoom.types';
import { creatZoomLookup } from './creatZoomLookup';
import { createZoomLookup } from './createZoomLookup';

export const createZoomMap = (zoom: ZoomData[]) => {
const zoomItemMap = new Map<AxisId, ZoomData>();
Expand Down Expand Up @@ -45,9 +45,15 @@ const selectorChartZoomMap = createSelector(
(zoom) => zoom?.zoomData && createZoomMap(zoom?.zoomData),
);

const selectorChartXZoomOptionsLookup = createSelector(selectorChartRawXAxis, creatZoomLookup('x'));
const selectorChartXZoomOptionsLookup = createSelector(
selectorChartRawXAxis,
createZoomLookup('x'),
);

const selectorChartYZoomOptionsLookup = createSelector(selectorChartRawYAxis, creatZoomLookup('y'));
const selectorChartYZoomOptionsLookup = createSelector(
selectorChartRawYAxis,
createZoomLookup('y'),
);

export const selectorChartZoomOptionsLookup = createSelector(
[selectorChartXZoomOptionsLookup, selectorChartYZoomOptionsLookup],
Expand Down

0 comments on commit 0028706

Please sign in to comment.