Customize color scale and palette
See original GitHub issueColor Palette customization (done) https://github.com/keplergl/kepler.gl/pull/601
User should be able to design custom color palette, they should be able to
- Click
using custom color palette
to toggle color palette editor - Start from blank, or start from an existing palette, (advanced: paste an array of hex values into an input box)
- Edit color value using a color picker, or input rgb, hex value
- Add and remove colors
- Drag to reorder colors
Color Value customization (in progress)
User should be able to import values next to each color, using dropdown for ordinal values and input box for numeric values. There will be a distribution graph for numeric values, user can drag the slider handle to adjust value range of each bin
Ordinal values
Implementation Step:
- Store value color Map in
layer.config.colorUI.colorRange.customPalette
, create a new propcolorMap
and save it as a JS Map
const colorMap = new Map([["foo", "#FFFFFF"], ["bar", "#000000"], ["foo1", "#FF0000"]]);
only store values manually selected by user. if user is using the “assign rest to one color” option, don’t store all the rest of the values to the map, later when create color scale, use the .unknown()
method to assign color to the rest of values.
- When calculate color based on custom color scale in
layer.getVisChannelScale
(base-layer.js). Use D3.ordinalScale and pass in thecolorMap
and a value forunknown
m = d3.scaleOrdinal()
.domain(colorMap.keys())
.range(colorMap.values())
.unknown('#fff000') // assign rest value to a color value
[Numeric values]
Add more color scale options
- Add log, sqrt and Jenkins natural break scale
Implementation steps:
- add log and sqrt scale (done) https://github.com/keplergl/kepler.gl/pull/670 1.5 add Jenkins natural breaks scale (in progress)
- Add a 'Use custom color palette ’ toggle under the reserved toggle (done) https://github.com/keplergl/kepler.gl/pull/601
- Allow edit color value using a color picker, or input rgb, hex value (done) https://github.com/keplergl/kepler.gl/pull/601
- Add input box to custom value domain for each color (ordinal and numeric value has different input UI) (not started)
- Add distribution graph for numeric values (not started)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:38
- Comments:25 (2 by maintainers)
Top Results From Across the Web
Creating custom color palettes and color scales - Qlik | Help
These examples show how to create color palettes and color scales for your custom themes. All properties referenced in the examples below are...
Read more >Data Viz Color Palette Generator (for Charts & Dashboards)
Use the palette chooser to create a series of colors that are visually equidistant. This is useful for many data visualizations, like pie...
Read more >Create Custom Color Palettes - Tableau Help
Tableau Desktop comes with color palettes that have been carefully designed to work well together and effectively apply color to data in many...
Read more >12.6 Using a Manually Defined Palette for a Continuous ...
Mapping continuous values to a color scale requires a continuously changing palette of colors. Table 12.2. lists the continuous color and fill scales....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding value customization is in progress:
Hi, Will this also include manual color range specification? It would be very useful not only to have automatic color range determination such as by quantile or quantize but manual range specification like in QGIS. E. g. color “#FFC300” for values between 0 and 50, “#F1920E” for values between 51 and … Thx, David