biocore / biocore/empress

Support changing colors from within a legend

Open
#368 0 comments 0 reactions 1 assignee Claimed by @kwcantrell View on GitHub
feature request refactoring
Dominant language
JavaScript
Stars
56
Forks
32
PR merge metrics
No merged PRs in 30d

Description

This would involve doing what Emperor does: rather than drawing just a colored square for each category we'd add a Spectrum.js colorpicker.

https://github.com/biocore/empress/blob/5d19f0dfd244b95d1ff60f3dc9a197db2bbe66c0/empress/support_files/js/legend.js#L145-L150

Actually adding the colorpickers likely wouldn't be too bad (although if a field has like a thousand groups it might slow down the page, see e.g. #344, so we may want to only create a colorpicker when a field is clicked on by the user) -- I think the hard part will likely be refactoring the code to use the selected colors efficiently? Like, preferably we'd store the `Colorer` created for a given field and just modify that, rather than calling `colorByFeatureMetadata` / `colorBySampleCat` again. Or maybe that wouldn't be too slow, I dunno.

This would impact:

- sample metadata coloring
- feature metadata coloring
- barplots (categorical feature metadata / stacked sample metadata)
- animations (I think colors are assigned based on the trajectory? We could probably draw a legend for the trajectory in the side panel, similarly to how barplot legends are drawn, so that users can manipulate it there.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.