-
Notifications
You must be signed in to change notification settings - Fork 271
feat(color): support better color interpolation for sequential schemes #547
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/5u09mb1lx |
Codecov Report
@@ Coverage Diff @@
## master #547 +/- ##
==========================================
- Coverage 23.21% 23.12% -0.09%
==========================================
Files 291 291
Lines 6790 6820 +30
Branches 675 684 +9
==========================================
+ Hits 1576 1577 +1
- Misses 5176 5204 +28
- Partials 38 39 +1
Continue to review full report at Codecov.
|
@@ -10,6 +11,11 @@ function range(count: number) { | |||
return values; | |||
} | |||
|
|||
function rangeZeroToOne(steps: number) { | |||
const denominator = steps - 1; | |||
return range(steps).map(i => i / denominator); |
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.
Can replace range
with [...new Array(steps).keys()]
@ktmud |
|
🏆 Enhancements
modifyRange
option tocreateLinearScale(domain, modifyRange = false)
. This extends the original behavior that always modifydomain
if needed.extent
option for.getColors(numColors, extent)
to reduce the range of the color scheme, inspiredSchemeParams
option in vega-lite