Skip to content

Commit

Permalink
fix(line): add missing tooltip prop to typings (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliyanyotov authored and plouc committed Jul 11, 2019
1 parent fa3c220 commit 0a90609
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/line/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ declare module '@nivo/line' {
export type LineCustomLayer = (props: LineCustomLayerProps) => React.ReactNode
export type Layer = LineLayerType | LineCustomLayer

export interface LineTooltipProps {
point: {
id: string
index: number
serieId: string | number
serieColor: string
x: number | string | Date
y: number | string | Date
color: string
borderColor: string
data: {
color: string
x: string | number
y: number
yStacked: number
xFormatted: string | number
yFormatted: string | number
}
}
}

export type TooltipProp = React.FC<LineTooltipProps>

export interface LineProps {
data: LineSerieData[]

Expand Down Expand Up @@ -137,6 +160,7 @@ declare module '@nivo/line' {
sliceTooltip?: (data: LineSliceData) => React.ReactNode

tooltipFormat?: TooltipFormatter | string
tooltip?: TooltipProp

enableCrosshair?: boolean
crosshairType?: CrosshairType
Expand Down

0 comments on commit 0a90609

Please sign in to comment.