-
Notifications
You must be signed in to change notification settings - Fork 271
Make CategoricalColorScale instance a function and remove .toFunction() #33
Conversation
ac794a7
to
1eb7522
Compare
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 41 42 +1
Lines 345 344 -1
=====================================
- Hits 345 344 -1
Continue to review full report at Codecov.
|
* Ensure value is a string | ||
* @param {any} value | ||
*/ | ||
export default function cleanValue(value) { |
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.
could we possibly make this have a more specific name? clean
is pretty generic, something like stringyifyAndTrim
would make it more readable/clear what exactly "clean" means.
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.
👍
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.
LGTM, had one suggestion for more specific func name 👌
🏆 Enhancement
Feat: Use the recently added
ExtensibleFunction
to make an instance ofCategoricalColorScale
be a function itself rather than having to call.toFunction()
to convert it into a color function.💔 Breaking Changes
BREAKING CHANGE: Remove
categoricalColorScale.toFunction()
.BREAKING CHANGE: The color scale no longer convert input to lowercase before finding color.
🐛 Bug Fix
Fix: Also apply
cleanValue
before setting color viasetColor(value, color)
in both color scale and color namespace levels.