Flexible options for color palette.
Currently, the color palette is hardcoded in visuals.py: https://github.com/MLWave/kepler-mapper/blob/0dfa7f736bd4218e8996888785b9d2adc63d5344/kmapper/visuals.py#L8-L15
and again in kmapper.js
https://github.com/MLWave/kepler-mapper/blob/0dfa7f736bd4218e8996888785b9d2adc63d5344/kmapper/static/kmapper.js#L25-L32
I'd like to see this
- [ ] duplication fixed and
- [ ] allow the palette to be an argument so users can choose a custom palette.
Reducing the duplication should be straight forward. Allowing arbitrary palettes might be more difficult. Does the current code assume palettes of a certain length?
Does the current code assume palettes of a certain length?
Yes. I think I could make the custom palette work and apply proper normalization. If we set a default with the current palette, then that would fix the duplication problem too (of course this logic would need to be moved from static, to grabbing the palette somewhere from the generated HTML).
Ideally, we could accept any matplotlib colormap (https://matplotlib.org/users/colormaps.html). There are a few coloring issues I'd like to take care of in the next month, I'll try to sink my teeth into them when I get a chance
- [ ] custom color palettes
- [ ] With a discrete coloring_function, we shouldn't average the value to choose the color, instead take the majority
- [ ] Toggle between multiple coloring_functions so we can easily compare.
Some of this is being handled by PR #113