Skip to content

Commit

Permalink
chore: converting more any to real type 10
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Sep 16, 2021
1 parent ae17f5c commit bb93b5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
34 changes: 17 additions & 17 deletions packages/charts/src/chart_types/xy_chart/annotations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export function invertTransformedCursor(
export function computeAnnotationDimensions(
annotations: AnnotationSpec[],
chartRotation: Rotation,
yScales: Map<GroupId, Scale<any>>,
xScale: Scale<any>,
yScales: Map<GroupId, Scale<number>>,
xScale: Scale<unknown>,
axesSpecs: AxisSpec[],
isHistogramModeEnabled: boolean,
smallMultipleScales: SmallMultipleScales,
Expand All @@ -145,22 +145,22 @@ export function computeAnnotationDimensions(
annotationDimensions.set(id, dimensions);
}
return annotationDimensions;
}

const dimensions = computeRectAnnotationDimensions(
annotationSpec,
yScales,
xScale,
axesSpecs,
smallMultipleScales,
chartRotation,
getAxisStyle,
isHistogramModeEnabled,
);
} else {
const dimensions = computeRectAnnotationDimensions(
annotationSpec,
yScales,
xScale as Scale<number>,
axesSpecs,
smallMultipleScales,
chartRotation,
getAxisStyle,
isHistogramModeEnabled,
);

if (dimensions) {
annotationDimensions.set(id, dimensions);
if (dimensions) {
annotationDimensions.set(id, dimensions);
}
return annotationDimensions;
}
return annotationDimensions;
}, new Map());
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* Side Public License, v 1.
*/

import { Scale } from '../../../../scales';
import { createCustomCachedSelector } from '../../../../state/create_selector';
import { getChartThemeSelector } from '../../../../state/selectors/get_chart_theme';
import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs';
import { AnnotationId, AxisId } from '../../../../utils/ids';
import { AnnotationId, AxisId, GroupId } from '../../../../utils/ids';
import { AnnotationDimensions } from '../../annotations/types';
import { computeAnnotationDimensions } from '../../annotations/utils';
import { computeSeriesGeometriesSelector } from './compute_series_geometries';
Expand Down Expand Up @@ -44,7 +45,7 @@ export const computeAnnotationDimensionsSelector = createCustomCachedSelector(
return computeAnnotationDimensions(
annotationSpecs,
settingsSpec.rotation,
yScales,
yScales as Map<GroupId, Scale<number>>,
xScale,
axesSpecs,
isHistogramMode,
Expand Down

0 comments on commit bb93b5a

Please sign in to comment.