Skip to content

Commit

Permalink
removed use of 'any' in the context of scales and thus removed lint w…
Browse files Browse the repository at this point in the history
…arnings
  • Loading branch information
tkonopka authored and plouc committed Apr 26, 2023
1 parent cb213f8 commit 8c36987
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/boxplot/src/BoxPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ const InnerBoxPlot = <RawDatum extends BoxPlotDatum>({
layerById.axes = (
<Axes
key="axes"
xScale={xScale as any}
yScale={yScale as any}
xScale={xScale}
yScale={yScale}
width={innerWidth}
height={innerHeight}
top={axisTop}
Expand Down Expand Up @@ -311,8 +311,8 @@ const InnerBoxPlot = <RawDatum extends BoxPlotDatum>({
key="grid"
width={innerWidth}
height={innerHeight}
xScale={enableGridX ? (xScale as any) : null}
yScale={enableGridY ? (yScale as any) : null}
xScale={enableGridX ? xScale : null}
yScale={enableGridY ? yScale : null}
xValues={gridXValues}
yValues={gridYValues}
/>
Expand Down
15 changes: 11 additions & 4 deletions packages/boxplot/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ import {
} from '@nivo/core'
import { InheritedColorConfig, OrdinalColorScaleConfig } from '@nivo/colors'
import { LegendProps } from '@nivo/legends'
import { ScaleBandSpec, Scale, ScaleLinearSpec, ScaleLogSpec, ScaleSymlogSpec } from '@nivo/scales'
import {
ScaleBandSpec,
AnyScale,
ScaleLinearSpec,
ScaleLogSpec,
ScaleSymlogSpec,
ScaleTimeSpec,
} from '@nivo/scales'
import { SpringValues } from '@react-spring/web'

export interface BoxPlotDatum {
Expand Down Expand Up @@ -95,8 +102,8 @@ export interface BoxPlotCustomLayerProps<RawDatum>

getTooltipLabel: (datum: BoxPlotSummary) => string | number

xScale: Scale<any, any>
yScale: Scale<any, any>
xScale: AnyScale
yScale: AnyScale
}

export type BoxPlotCustomLayer<RawDatum> = React.FC<BoxPlotCustomLayerProps<RawDatum>>
Expand Down Expand Up @@ -174,7 +181,7 @@ export type BoxPlotCommonProps<RawDatum> = {
innerPadding: number
padding: number

valueScale: ScaleLinearSpec | ScaleLogSpec | ScaleSymlogSpec
valueScale: ScaleLinearSpec | ScaleLogSpec | ScaleSymlogSpec | ScaleTimeSpec
indexScale: ScaleBandSpec

enableGridX: boolean
Expand Down

0 comments on commit 8c36987

Please sign in to comment.