Skip to content

Commit

Permalink
fix(scatterplot): Support DerivedNodeProp for nodeSize prop (#1134)
Browse files Browse the repository at this point in the history
Adds support for DerivedNodeProp<number> so when a function is passed to nodeSize
the id of the node can be referenced. The current implementation uses only DerivedDatumProp<number>
and the Datum type only has x and y fields where as Node also contains its id.

Also, the nivo docs at https://nivo.rocks/scatterplot/ specify
"it will receive the current node and must return a number"
which is consistent with the proposed type.
  • Loading branch information
spinloop committed Oct 10, 2020
1 parent 861000f commit 42adacd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/scatterplot/index.d.ts
Expand Up @@ -138,7 +138,7 @@ declare module '@nivo/scatterplot' {
axisBottom?: AxisProps | null
axisLeft?: AxisProps | null

nodeSize?: number | DerivedDatumProp<number> | DynamicSizeSpec
nodeSize?: number | DerivedDatumProp<number> | DynamicSizeSpec | DerivedNodeProp<number>

isInteractive?: boolean
useMesh?: boolean
Expand Down

0 comments on commit 42adacd

Please sign in to comment.