Skip to content
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

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

maddles
Copy link
Contributor

@maddles maddles commented Apr 24, 2020

  • Enforce number from cursorLabel function
  • Added VictoryCursorContainer demo

@maddles maddles marked this pull request as draft April 24, 2020 20:16
@maddles maddles marked this pull request as ready for review April 24, 2020 20:29
@maddles maddles marked this pull request as ready for review April 24, 2020 20:46
@@ -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;
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

@boygirl boygirl left a 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.

@boygirl
Copy link
Contributor

boygirl commented Apr 28, 2020

Approved!

@maddles maddles merged commit 86e6cbb into master Apr 28, 2020
@boygirl boygirl deleted the task/audit-victory-cursor-container-typescript-props branch June 23, 2020 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants