-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add config option to map values to colors #4894
Conversation
A couple of things:
|
Okay, so I made some pretty drastic changes. I moved the logic that maps colors from color.js to mapped_colors.js. I also modified the latter file to return a singleton instead of a class that needs to be instantiated (I anticipate that only one instance will ever be needed). Prior to these changes, mapped_colors was essentially just a set, but now it has some important functionality that checks the colors mapped by the user's config, and picks colors that the user hasn't already used in the config. |
color = getColors(arr); | ||
})); | ||
|
||
afterEach(ngMock.inject(function (config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick - kind of inconsistent here in that you use fat arrow syntax in other new code
LGTM - other than those 2 things |
Passing to @rashidkpc for a quick final look. |
Add config option to map values to colors
Closes #4817.
This PR adds a config option that allows users to associate colors with specific values, and defaults Count to be the standard green, so that it's not mapped to different colors based on the context of the application.