Skip to content

Commit

Permalink
fix(radar): provide datum to InheritedColorConfig type
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze committed Jun 29, 2021
1 parent a9f392e commit dcf8517
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/radar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ declare module '@nivo/radar' {
anchor: 'start' | 'middle' | 'end'
angle: number
}
export type PointData = {
index: number
key: string
value: number
color: string
}
export type DotSymbolProps = {
size: number
color: InheritedColorConfig
color: InheritedColorConfig<PointData>
borderWidth: number
borderColor: InheritedColorConfig
borderColor: InheritedColorConfig<PointData>
}

type IndexByCustomFunction<D = any> = (datum: D) => string | number
Expand All @@ -31,7 +37,7 @@ declare module '@nivo/radar' {
export type CustomFormatter = (...args: any[]) => React.ReactNode

interface CommonRadarProps<Datum = any> {
data: object[]
data: Datum[]
keys: (string | number)[]
indexBy: number | string | IndexByCustomFunction<Datum>
maxValue?: 'auto' | number
Expand All @@ -41,7 +47,7 @@ declare module '@nivo/radar' {
curve?: string

borderWidth?: number
borderColor?: InheritedColorConfig
borderColor?: InheritedColorConfig<Record<'color' | 'key', string>>

gridLevels?: number
gridShape?: 'circular' | 'linear'
Expand All @@ -51,9 +57,9 @@ declare module '@nivo/radar' {
enableDots?: boolean
dotSymbol?: CustomDotSymbol
dotSize?: number
dotColor?: InheritedColorConfig
dotColor?: InheritedColorConfig<PointData>
dotBorderWidth?: number
dotBorderColor?: InheritedColorConfig
dotBorderColor?: InheritedColorConfig<PointData>
enableDotLabel?: boolean
dotLabel?: string | CustomDotLabel
dotLabelFormat?: string | CustomFormatter
Expand Down

0 comments on commit dcf8517

Please sign in to comment.