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

Fix color sorting in the legend #765

Merged
merged 18 commits into from
May 29, 2020
Merged

Conversation

fedarko
Copy link
Contributor

@fedarko fedarko commented May 23, 2020

Closes #761; see #761 (comment) for details on the way I fixed the bug.

Along with the fix to DecompositionView.setCategory(), I also added in a test to make sure that these changes remain in effect. Also made some minor code fixes in test_decomposition_view.js.

Hope this is useful!

fedarko added 15 commits May 11, 2020 11:58
Modified the function and added a unit test verifying this.
Both modifications are from Empress' codebase, specifically in
the PR biocore/empress#159.
As expected, this causes the JS tests to fail due to small precision
differences. Will need to update those.
Closes biocore#760. Tests are broken, though, so will need to fix those
(along with tests broken from fixing biocore#762).
Both seem to be accepted by Chroma.js, but may as well be consistent
with what their docs use (also, the Emperor docstrings said "Viridis"
in spite of this not being followed).
Also added an empress code attribution to getInterpolatedColors()
emphasis on "partial", would prefer to automate this
Just did this by copying in the new output (finagled it to roughly
match the old expected output's formatting for purposes of making
the diff cleaner).

Now that tests pass, I'm gonna say that this officially closes biocore#762 :)
Addresses @wasade's comment.

NOTE that biocore#761 is still gonna mess things up, though. Will comment
accordingly in biocore#763.
Fixes biocore#761. May be worth adding tests at some point, but since this
change didn't break any tests I guess this would require writing new
tests rather than updating any current ones.
Still need to, like, actually set up a data JSON to provide to
setCategory(), but I don't think that should be too bad
Long story short, some tests declared "var obs;" and then didn't
do anything with obs, while other tests assigned something to obs
without actually declaring it first. I tried to make things
consistent.
Copy link
Member

@ElDeveloper ElDeveloper 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 really good, thanks @fedarko. Tested this locally and it is working as expected. Would you mind adding an entry to the Changelog pertaining to these changes and to the changes in #763?

],
percents_explained: [80.0, 20.0]
};
var md_headers = ['SampleID', 'DeliberatelyAnnoyingField'];
Copy link
Member

Choose a reason for hiding this comment

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

😆

@fedarko
Copy link
Contributor Author

fedarko commented May 29, 2020

@ElDeveloper done, thanks!

fedarko added 2 commits May 29, 2020 14:58
(for some reason it decided to get angry at using ""s instead of ''s,
the version being downloaded probably got updated or something since
this stuff was passing last week)
...since there is no scripts/ folder in Emperor any more.

This is really bizarre, though -- this was definitely not failing
last week: see
https://travis-ci.com/github/biocore/emperor/jobs/339150405.

It looks like the flake8 version was updated between python 3.6 builds
on Travis (3.7.9 to 3.8.2), but I have v3.7.9 installed on my computer
and running the flake8 command here still gives me an error about
scripts/ not being a real directory.

Uh, I think the path of least resistance is just fixing this for right
now, but I'm very confused.
@fedarko
Copy link
Contributor Author

fedarko commented May 29, 2020

For some reason, it looks like the gjslint / flake8 versions used on Travis changed between last week and this week -- hence why the build was failing. Things should be fixed now (most of the complaints were minor things like double vs. single quotes).

Copy link
Member

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

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

Thanks so much @fedarko!

@ElDeveloper ElDeveloper merged commit e874f04 into biocore:master May 29, 2020
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.

Inconsistent sorting for mixed-type (numeric + non-numeric) fields in the color legend
2 participants