biocore / emperor

Emperor a tool for the analysis and visualization of large microbial ecology datasets
http://biocore.github.io/emperor/
Other
52 stars 50 forks source link

Some (mostly coloring-focused) bug fixes #763

Closed fedarko closed 4 years ago

fedarko commented 4 years ago

Closes #760 and closes #762. Also fixes that naturalSort() Infinity issue we talked about (there isn't an open issue for that though).

The JavaScript tests have mostly all been updated. This involved updating both the expected colors from the interpolation fixes, as well as updating slightly different colors due to the new Chroma.js version. (For the two tests that directly checked gradient SVG equality, I elected to just copy in the new expected SVG over the old expected SVG markup -- changing each hex color manually seemed kinda daunting, as shown in the QUnit diff below.)

errors

I also tested this manually, and can confirm that this resolves #760 -- see below, where the interpolated Viridis colors now extend to cover the full color map.

image

fedarko commented 4 years ago

Comments have been addressed. It's worth noting that scientific notation numbers like 1e2 are handled as expected by naturalSort() (and this is now explicitly tested for), but the legend is still not sorting things correctly since this PR doesn't address #761. So datasets can still look something like

image

... where the colors are assigned correctly, but the legend is out of order.

If y'all would like me to I can try to address #761 in this PR as well, but I'm not sure where to look for that.

Thanks!