Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible options for color palette. #112

Open
2 tasks
sauln opened this issue Aug 14, 2018 · 3 comments
Open
2 tasks

Flexible options for color palette. #112

sauln opened this issue Aug 14, 2018 · 3 comments

Comments

@sauln
Copy link
Member

sauln commented Aug 14, 2018

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?

@MLWave
Copy link
Member

MLWave commented Sep 2, 2018

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

@sauln
Copy link
Member Author

sauln commented Sep 7, 2018

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 sauln mentioned this issue Sep 13, 2018
@sauln
Copy link
Member Author

sauln commented Sep 14, 2018

Some of this is being handled by PR #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants