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

Dynamic Color Scaling Based on Maximum Contribution Value #132

Open
marcosagni98 opened this issue Nov 7, 2024 · 1 comment
Open

Dynamic Color Scaling Based on Maximum Contribution Value #132

marcosagni98 opened this issue Nov 7, 2024 · 1 comment

Comments

@marcosagni98
Copy link

Hello!

It would be helpful if the library dynamically determined color ranges based on the maximum contribution count in the data provided. Currently, colors need to be manually set according to fixed ranges, but making the color scale adjust automatically would improve flexibility and reduce the need for manual configuration.

Suggested Enhancement:

Allow the color scale to automatically adjust based on the highest contribution count in the input data. For example, if the data includes values up to 50 contributions, the library would calculate color levels relative to this maximum (or any other detected maximum). This way, we wouldn’t need to adjust colors manually for different data ranges.

Benefits:

  • Improved flexibility for varying data ranges.
  • No need for manual color adjustments for each dataset.
  • Better integration with different data sources and types of contribution frequencies.
@jaywcjlove
Copy link
Member

@marcosagni98 Not sure if the new implementation meets your requirements.

<HeatMap
  value={value}
  width={600}
  style={{ color: '#ad001d', '--rhm-rect-active': 'red' }}
  startDate={new Date('2016/01/01')}
+  panelColors={['#f4decd', '#e4b293', '#d48462', '#c2533a', '#ad001d', '#6c0012']}
 />

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

2 participants