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

Add brush selection #766

Closed ElDeveloper closed 4 years ago

ElDeveloper commented 4 years ago

The user can now hold shift and select a group of samples (see animated GIF):

brush-select

Now that the functionality is in place, we have to decide what do we do with the selected samples. For now the color is changed, and the sample list is printed to the console. Next, we can copy the list of samples to the clipboard. In any case this callback will be helpful to integrate with other visualization tools.

You'll notice this required that THREE was updated to the latest version. A number of API calls were updated along the way. Changes to any of those JavaScript files should pretty much be ignored.

antgonza commented 4 years ago

Really cool! I guess a good start would be to copy the sample names to the clipboard so a user can copy/paste them to another tool. This, makes me wonder how this new feature will work in the large PCoA's we have been creating, for example the +113K samples one. Perhaps, then as a following step (other PR), it would be nice to be able to define some kind of API so that selection creates a button, that can be pressed and a new filter of the distance matrix and pcoa job can be sent do QIIME2/Qiita (I can imagine a config file that allows configuration of this feature) ...

ElDeveloper commented 4 years ago

This should be ready for review merge the main things that have changed since last time:

Here's how things look with a small dataset:

selection-small

And for a sample set with 80K samples, everything remains fairly responsive:

selection-80k

ElDeveloper commented 4 years ago

Only a few minor comments; BTW should all three.js-plugins/*.js be minimized?

We haven't in the past since there's a couple of things that we modify for our own code. Some patches which have been accepted in mrdoob/three.js some which haven't (yet).

ElDeveloper commented 4 years ago

Thanks for reviewing @antgonza!