kepler-mapper icon indicating copy to clipboard operation
kepler-mapper copied to clipboard

Flexible options for color palette.

Open sauln opened this issue 7 years ago • 3 comments

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?

sauln avatar Aug 14 '18 16:08 sauln

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).

MLWave avatar Sep 02 '18 21:09 MLWave

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.

sauln avatar Sep 07 '18 16:09 sauln

Some of this is being handled by PR #113

sauln avatar Sep 14 '18 20:09 sauln