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

TimeRange emptyColor #1661

Closed
anton-johansson opened this issue Jul 5, 2021 · 7 comments
Closed

TimeRange emptyColor #1661

anton-johansson opened this issue Jul 5, 2021 · 7 comments
Labels

Comments

@anton-johansson
Copy link

Describe/explain the bug

According to the documentation, the TimeRange (and ResponsiveTimeRange) should have the emptyColor property, just like the Calendar component. You can see it here:

An array of colors to be used in conjunction with domain to compute days' color. It applies to days having a value defined, otherwise, emptyColor will be used.

To Reproduce
https://codesandbox.io/s/frosty-swartz-07f8z?file=/src/App.js

Expected behavior
I expect the emptyColor property to exist and have an effect. In my case, the time range will feel very empty if I don't have those "empty" boxes. :(

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser Chrome
  • Version 90.0.4430.93

Additional context
Add any other context about the problem here.

@wyze wyze added 📆 calendar @nivo/calendar package 🆕 feature request labels Jul 6, 2021
@yozibak
Copy link

yozibak commented Aug 12, 2021

Hi, I also want this feature to be added.
Though my current workaround here is to generate Array of objects which value is 0,
and set the first item of color array to be emptyColor.

Screen Shot 2021-08-12 at 18 47 58

But the problem is if the data value range is rather large, smaller value items also set to be emptyColor.
Or can I set each item with specific color?

@vgeary96
Copy link
Contributor

We wanted to use the TimeRange component as well but this is stopping us. Looking at the code I think the best way to go about this would be to add support for from, to, and emptyColor props and support holes in the data set like the Calendar component.

@wyze have those features already been planned out? If not I'd be willing to give it a go.

@wyze
Copy link
Contributor

wyze commented Aug 16, 2021

Not planned out, a PR would be great.

@vgeary96
Copy link
Contributor

vgeary96 commented Aug 18, 2021

@wyze let me know what you think, most of the changes were inspired by the calendar component :) #1722

@wyze
Copy link
Contributor

wyze commented Aug 23, 2021

Closed via #1722.

@wyze wyze closed this as completed Aug 23, 2021
@321ckatz123
Copy link

321ckatz123 commented Oct 4, 2021

@wyze this does not appear to have been pushed to npm. Can you please push this PR?

@plouc
Copy link
Owner

plouc commented Oct 9, 2021

@321ckatz123, I just published 0.74.0, which includes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants