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

Coloring root nodes of collapsed clades? #321

Closed
fedarko opened this issue Aug 11, 2020 · 2 comments
Closed

Coloring root nodes of collapsed clades? #321

fedarko opened this issue Aug 11, 2020 · 2 comments

Comments

@fedarko
Copy link
Collaborator

fedarko commented Aug 11, 2020

We talked a bit about this a few days ago, so I'm making a note of it here for future reference. I think it might make sense to color in the root nodes of collapsed clades, since they would already be colored that way if collapsing were not done. If opinions are split on which option (color root vs. don't color root) looks better / is more useful, we could make this an option in "Tree Properties" as well.

image

@fedarko
Copy link
Collaborator Author

fedarko commented Aug 25, 2020

for reference, this seems to be configurable by removing this line:

// We set the root of the clade to default otherwise, the branch that
// connects the root clade to its parent will still be colored
this.setNodeInfo(this._treeData[rootNode], "color", this.DEFAULT_COLOR);

here's what this looks like on the same portion of the MP tree --

image

The main benefit is that this is nice for certain trees where the collapsed clade's area is relatively small, e.g. the MP tree in rect layout collapsed at level 1 taxonomy --

image

image

notice the small red clade containing the only Archaea-classified features in the tree. In the first screenshot it's still visible (it's just really tiny), but in the second screenshot coloring the root branch red makes (like normal) makes it a lot more visible.

@ElDeveloper
Copy link
Member

Thanks for putting this together @fedarko, this makes a lot of sense. Thinking about it the collapsing shouldn't change the coloring of the branches, so we either extend the polygons to the top of the branch, or we color the branch as you suggest. I suspect leaving the branch makes for a more aesthetically pleasing representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants