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

New color map #483

Merged
merged 11 commits into from
Feb 23, 2021
Merged

New color map #483

merged 11 commits into from
Feb 23, 2021

Conversation

kwcantrell
Copy link
Collaborator

This PR adds a new custom diverging color map (green to light orange to purple) that is great for coloring tree branches as a lot of the other diverging color maps are either hard to see the separation of values and/or the middle values are colored to light which makes the branches hard to see.
log_ratio
You can see that this color map does a good job separating the two extreme values (i.e. endpoints) from the middle values while still making everything visible on screen.

Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks dope! A few small finicky changes I think would improve clarity, but this should be good to go without much tweaking. Thanks for adding this!

empress/support_files/js/colorer.js Outdated Show resolved Hide resolved
empress/support_files/js/colorer.js Outdated Show resolved Hide resolved
empress/support_files/js/colorer.js Outdated Show resolved Hide resolved
empress/support_files/js/colorer.js Outdated Show resolved Hide resolved
empress/support_files/js/colorer.js Show resolved Hide resolved
@kwcantrell
Copy link
Collaborator Author

@fedarko thanks for reviewing this! I think I have addressed all of your comments.

@fedarko fedarko self-requested a review February 22, 2021 23:06
Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kwcantrell! This looks great -- I have one suggestion, but we could probably merge this in even without it.

empress/support_files/js/colorer.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to nitpick but I have one more suggestion (I don't think it's needed but it will probably cause confusion if left unfixed). Aside from that, this looks good!

@@ -553,6 +565,8 @@ define(["chroma", "underscore", "util"], function (chroma, _, util) {
"#808000",
"#008080",
];
Colorer.__GR_OR_PR = "GnOrPr";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Colorer.__GR_OR_PR = "GnOrPr";
Colorer.__GN_OR_PR = "GnOrPr";

Just to make this consistent with Colorer.__gnOrPr -- if we use different abbreviations i suspect it'll cause problems down the line

@@ -244,7 +251,12 @@ define(["chroma", "underscore", "util"], function (chroma, _, util) {
} else {
domain = [min, max];
}
var interpolator = chroma.scale(this.color).domain(domain);
var interpolator;
if (this.color === Colorer.__GR_OR_PR) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.color === Colorer.__GR_OR_PR) {
if (this.color === Colorer.__GN_OR_PR) {

@@ -175,15 +175,22 @@ define(["chroma", "underscore", "util"], function (chroma, _, util) {
);
}

var interpolator;
if (this.color === Colorer.__GR_OR_PR) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.color === Colorer.__GR_OR_PR) {
if (this.color === Colorer.__GN_OR_PR) {

@kwcantrell
Copy link
Collaborator Author

Sorry to nitpick but I have one more suggestion (I don't think it's needed but it will probably cause confusion if left unfixed). Aside from that, this looks good!

Nitpick away :)

It should be fixed now.

@fedarko
Copy link
Collaborator

fedarko commented Feb 23, 2021

Perfect, thanks so much!

@fedarko fedarko merged commit f732852 into biocore:master Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants