diff --git a/packages/axes/src/components/Axes.tsx b/packages/axes/src/components/Axes.tsx index 47c2b6da9..b0ddfcb52 100644 --- a/packages/axes/src/components/Axes.tsx +++ b/packages/axes/src/components/Axes.tsx @@ -1,7 +1,7 @@ import React from 'react' import { Axis } from './Axis' import { positions } from '../props' -import { AnyScale, AxisProp, AxisValue } from '../types' +import { AnyScale, SingleAxisProp, AxisValue } from '../types' export const Axes = ({ xScale, @@ -17,10 +17,10 @@ export const Axes = ({ yScale: AnyScale width: number height: number - top?: AxisProp - right?: AxisProp - bottom?: AxisProp - left?: AxisProp + top?: SingleAxisProp + right?: SingleAxisProp + bottom?: SingleAxisProp + left?: SingleAxisProp }) => { const axes = { top, right, bottom, left } @@ -28,8 +28,8 @@ export const Axes = ({ <> {positions.map(position => { const axis = axes[position] as typeof position extends 'bottom' | 'top' - ? AxisProp | undefined - : AxisProp | undefined + ? SingleAxisProp | undefined + : SingleAxisProp | undefined if (!axis) return null diff --git a/packages/axes/src/types.ts b/packages/axes/src/types.ts index 0c1047fa8..09a177615 100644 --- a/packages/axes/src/types.ts +++ b/packages/axes/src/types.ts @@ -55,7 +55,7 @@ export type AxisLegendPosition = 'start' | 'middle' | 'end' export type ValueFormatter = (value: Value) => Value | string -export interface AxisProp { +export interface SingleAxisProp { ticksPosition?: 'before' | 'after' tickValues?: TicksSpec tickSize?: number @@ -69,7 +69,7 @@ export interface AxisProp { } export interface CanvasAxisProp - extends Omit, 'legend'> { + extends Omit, 'legend'> { legend?: string }