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 364 #433

Merged
merged 11 commits into from
Nov 20, 2020
Merged

Fix 364 #433

merged 11 commits into from
Nov 20, 2020

Conversation

kwcantrell
Copy link
Collaborator

Resolves #364. This implements a binary search and also limits the number of suggestions to 10 ids

Here is a link to the improved version and here is a link to the original version.

You can test them by searching for 'taag' in the node search box.

@emperor-helper
Copy link

The following artifacts were built for this PR: empire-biplot.qzv, empire.qzv, empress-tree.qzv, just-fm.qzv, plain.qzv

@fedarko fedarko self-requested a review November 7, 2020 00:53
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! Some suggestions -- main thing is that it looks like the functionality added is still commented out, and should be re-enabled. Also, I think the null-filtering should probably be re-enabled, as well.

empress/support_files/js/empress.js Outdated Show resolved Hide resolved
empress/support_files/js/canvas-events.js Outdated Show resolved Hide resolved
empress/support_files/js/canvas-events.js Outdated Show resolved Hide resolved
empress/support_files/js/canvas-events.js Outdated Show resolved Hide resolved
empress/support_files/js/canvas-events.js Outdated Show resolved Hide resolved
@fedarko fedarko self-requested a review November 17, 2020 05:44
@fedarko
Copy link
Collaborator

fedarko commented Nov 17, 2020

Thanks so much @kwcantrell! Going through the updates now :)

@antgonza Quick question -- is it possible to send a "kick"/trigger message to McHelper? Going by the provenance / functionality it looks like the QZVs for this PR haven't been updated in response to the recent commits to this branch, which is making manual testing a bit more cumbersome here. (We can discuss tomorrow morning if you'll be at the meeting, no worries)

funky

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.

A few suggestions (mostly documentation but one functionality thing). Thanks so much, this is looking awesome!

empress/support_files/js/canvas-events.js Show resolved Hide resolved
empress/support_files/js/canvas-events.js Outdated Show resolved Hide resolved
// not all node ids were listed in the autofill box
// create an elipse autofill to let users know there are more
// possible options
if (suggestionsAdded < ids.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like the ... shows up even if there is only one value shown in the menu -- I think this is because there is only one possible "option" here, i.e. the 0.000 name, so suggestionsAdded for the query 0.000 is immediately less than ids.length. I thought at first that this might be a result of the unique-filtering code you added, but from going through the code I don't think that's the reason.

I think (?) there should instead be some logic that distinguishes between when we already have 10 suggestions added and we had to cut things off (in which case we should show the ...), and the other cases (e.g. the query is so specific that 10 or fewer items are shown, in which case we should not show the ...)

uniqs_huh

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

@fedarko, my guess is that d9f6850 and 056f93b happened too quickly; @kwcantrell, could you do one push with some minimal changes to see if things work fine?

@@ -443,6 +443,7 @@ define([
// specified name in the Newick file) in the auto-complete.
nodeNames = nodeNames.filter((n) => n !== null);
nodeNames.sort();
Copy link
Collaborator

@fedarko fedarko Nov 17, 2020

Choose a reason for hiding this comment

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

https://stackoverflow.com/a/9645447/10730311 -- we should sort case insensitively

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.

Some tiny comments, but this is pretty much fine as is. Thanks so much @kwcantrell!

nodeNames.sort(function (a, b) {
return a.localeCompare(b, "en", { sensitivity: "base" });
});
console.log(nodeNames);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you remove the console.log here?

Also -- do you think it might make sense to move some of this code to a new utility function that just takes a list of node names and filters nulls, sorts it case-insensitively, and filters it to unique stuff? This way, it'd be a lot easier to test this functionality directly. (I mean it works now, so it's not a big issue or anything, but it would probs make the code a bit cleaner.) Not something we have to do in this PR, necessarily.

nodeNames.sort();
nodeNames.sort(function (a, b) {
return a.localeCompare(b, "en", { sensitivity: "base" });
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool! No idea this existed, this seems like a good way of handling this.

empress/support_files/js/empress.js Show resolved Hide resolved
@fedarko fedarko merged commit c7a7248 into biocore:master Nov 20, 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.

Ensure node searching is handled well for large trees
4 participants