Skip to content

Commit

Permalink
chore: converting more any to real type 09
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Sep 16, 2021
1 parent 3607f0a commit ae17f5c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/charts/src/chart_types/xy_chart/rendering/area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function renderArea(
shift: number,
dataSeries: DataSeries,
xScale: Scale<unknown>,
yScale: Scale<unknown>,
yScale: Scale<number>,
panel: Dimensions,
color: Color,
curve: CurveType,
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/chart_types/xy_chart/rendering/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function renderLine(
shift: number,
dataSeries: DataSeries,
xScale: Scale<unknown>,
yScale: Scale<unknown>,
yScale: Scale<number>,
panel: Dimensions,
color: Color,
curve: CurveType,
Expand Down
8 changes: 4 additions & 4 deletions packages/charts/src/chart_types/xy_chart/rendering/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function isPointOnGeometry(
return yCoordinate >= y && yCoordinate <= y + height && xCoordinate >= x && xCoordinate <= x + width;
}

const getScaleTypeValueValidator = (yScale: Scale<any>): ((n: number) => boolean) => {
const getScaleTypeValueValidator = (yScale: Scale<unknown>): ((n: number) => boolean) => {
if (!isLogarithmicScale(yScale)) return () => true;

const domainPolarity = getDomainPolarity(yScale.domain);
Expand All @@ -178,7 +178,7 @@ export type YDefinedFn = (
) => boolean;

/** @internal */
export function isYValueDefinedFn(yScale: Scale<any>, xScale: Scale<unknown>): YDefinedFn {
export function isYValueDefinedFn(yScale: Scale<unknown>, xScale: Scale<unknown>): YDefinedFn {
const validator = getScaleTypeValueValidator(yScale);
return (datum, getValueAccessor) => {
const yValue = getValueAccessor(datum);
Expand All @@ -201,7 +201,7 @@ function chromeRenderBugBuffer(y1: number, y0: number): number {
}

/** @internal */
export function getY1ScaledValueOrThrowFn(yScale: Scale<unknown>): (datum: DataSeriesDatum) => number {
export function getY1ScaledValueOrThrowFn(yScale: Scale<number>): (datum: DataSeriesDatum) => number {
const datumAccessor = getYDatumValueFn();
const scaleY0Value = getY0ScaledValueOrThrowFn(yScale);
return (datum) => {
Expand All @@ -212,7 +212,7 @@ export function getY1ScaledValueOrThrowFn(yScale: Scale<unknown>): (datum: DataS
}

/** @internal */
export function getY0ScaledValueOrThrowFn(yScale: Scale<any>): (datum: DataSeriesDatum) => number {
export function getY0ScaledValueOrThrowFn(yScale: Scale<number>): (datum: DataSeriesDatum) => number {
const isLogScale = isLogarithmicScale(yScale);
const domainPolarity = getDomainPolarity(yScale.domain);
const logBaseline = domainPolarity >= 0 ? Math.min(...yScale.domain) : Math.max(...yScale.domain);
Expand Down
4 changes: 2 additions & 2 deletions packages/charts/src/chart_types/xy_chart/state/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function renderGeometries(
(xScale.bandwidth * lineShift) / 2,
ds,
xScale,
yScale,
yScale as Scale<number>,
panel,
color,
spec.curve || CurveType.LINEAR,
Expand Down Expand Up @@ -471,7 +471,7 @@ function renderGeometries(
(xScale.bandwidth * areaShift) / 2,
ds,
xScale,
yScale,
yScale as Scale<number>,
panel,
color,
spec.curve || CurveType.LINEAR,
Expand Down

0 comments on commit ae17f5c

Please sign in to comment.