Skip to content

Commit

Permalink
fix(sankey): update onClick types in sankey chart to respect generics (
Browse files Browse the repository at this point in the history
…#2509)

* Fix onClick types in sankey chart

* Update types.ts
  • Loading branch information
stas-demydiuk authored Feb 5, 2024
1 parent d87af09 commit bc18832
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sankey/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface SankeyDataProps<N extends DefaultNode, L extends DefaultLink> {

export type SankeyLayerId = 'links' | 'nodes' | 'labels' | 'legends'

export type SankeyMouseHandler = <N extends DefaultNode, L extends DefaultLink>(
export type SankeyMouseHandler<N extends DefaultNode, L extends DefaultLink> = (
data: SankeyNodeDatum<N, L> | SankeyLinkDatum<N, L>,
event: MouseEvent
) => void
Expand Down Expand Up @@ -142,7 +142,7 @@ export interface SankeyCommonProps<N extends DefaultNode, L extends DefaultLink>
labelTextColor: InheritedColorConfig<SankeyNodeDatum<N, L>>

isInteractive: boolean
onClick: SankeyMouseHandler
onClick: SankeyMouseHandler<N, L>
nodeTooltip: FunctionComponent<{ node: SankeyNodeDatum<N, L> }>
linkTooltip: FunctionComponent<{ link: SankeyLinkDatum<N, L> }>

Expand Down

0 comments on commit bc18832

Please sign in to comment.