question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing 'colorBy' type in BarSvgProps

See original GitHub issue

I created a ResponsiveBarChart and I added colors and colorBy props to adjust the colors of the bars. How every TypeScript compiler complains about colorBy prop being missed in the prop types. More specifically, colorBy prop is not in BarProps

I would love to open a PR for this but couldn’t find a contribution guide so created this issue instead.

Screen Shot 2020-08-20 at 1 22 00 PM

Funny that there are two workarounds in the screenshot for different Typescript issues.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
wyzecommented, Aug 21, 2020

To achieve the same results you would do this:

+import { getOrdinalColorScale } from '@nivo/colors'


```diff
<ResponsiveBar
        margin={{ top: 32, right: 48, bottom: 56, left: 48 }}
-       colors={{ scheme: 'orange_red' }}
-       colorBy="index"
+       colors={getOrdinalColorScale({ scheme: 'orange_red' }, 'index')}
        layout="horizontal"
1reaction
eggeicommented, Aug 21, 2020

Me too, but couldn’t find it. Thanks so much for helping, again!

Hey @plouc - I just wanted to let you know about this thread. It might be very useful to have this info in https://nivo.rocks/guides/colors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

日本特売 新オリジナル6SX7010-0FF05 6SX7 010-0FF05 ...
Missing 'colorBy' type in BarSvgProps · Issue #1106 · plouc/nivo ... The Nonlinear Circuits Thread - Equipment - lines.
Read more >
nivo - TypeScript definitions | bleepcoder.com
Hi! just wanted to mention that there are some type definitions missing for the ... [x] I think colorBy and tooltip should receive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found