-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit typescript props and add a demo for VictoryCursorContainer #1532
Audit typescript props and add a demo for VictoryCursorContainer #1532
Conversation
maddles
commented
Apr 24, 2020
•
edited
Loading
edited
- Enforce number from cursorLabel function
- Added VictoryCursorContainer demo
@@ -4,7 +4,7 @@ import { VictoryContainerProps, CursorData } from "victory-core"; | |||
export interface VictoryCursorContainerProps extends VictoryContainerProps { | |||
cursorComponent?: React.ReactElement; | |||
cursorDimension?: "x" | "y"; | |||
cursorLabel?: (point: CursorData) => void; | |||
cursorLabel?: (point: CursorData) => number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. cursorLabel
should be able to return a string, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I do string | number, or is there a situation where void should be accepted too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, folks sometimes return null to render no label for a given data point. Let's leave this one as flexible as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove cursorLabel
enforcing a numeric return value. Otherwise approved.
Approved! |