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

TypeScript doesn't allow for a function on property pointLabel of Line charts #891

Closed
mjsarfatti opened this issue Mar 10, 2020 · 0 comments

Comments

@mjsarfatti
Copy link
Contributor

Describe/explain the bug
Using @nivo/line, when declaring

<ResponsiveLine
  ...
  pointLabel={d => Math.round((d.y / d.total) * 100) + '%'}
  ...
/>

TypeScript complains that Type '(d: any) => string' is not assignable to type 'string'.

To Reproduce
Please see https://codesandbox.io/s/unruffled-architecture-b0k19 [line 204 of App.js]

Steps to reproduce the behavior:

  1. It's sufficient to create a Line chart and assign a function to the property pointLabel

Expected behavior
The declaration file should probably be patched to allow for a function, since the code already allows it.

@wyze wyze closed this as completed in b5464bb May 17, 2020
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

No branches or pull requests

1 participant