biocore / biocore/empress

Use smoother curves to draw circular layout barplots for trees with only a few tips

Open
#508 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
56
Forks
32
PR merge metrics
No merged PRs in 30d

Description

To draw barplots in the circular layout, EMPress uses four triangles for each tip in the tree's "bar". When there are over a couple of tips (probably somewhere in the 10-50 tips range) this looks nice, but below this threshold the approximation is really obvious, and the barplots look very angular:

![image](https://user-images.githubusercontent.com/4177727/112920723-62296c80-90be-11eb-9f64-8c768c19bb50.png)
(This screenshot is really old - it's from the #357 PR - but the idea is the same.)

It turns out that this approximation can actually cause the barplots to overlap the tree, in the rare case where the curves from the circular layout extend "beyond" the lack of curves of the barplots (I think the tips having relatively short branch lengths is related to this).

![Peek 2021-03-29 18-45](https://user-images.githubusercontent.com/4177727/112921100-07dcdb80-90bf-11eb-816a-22ca1fa9ac18.gif)

IMO this upgrades this problem from "ugly" to "actually a bug" -- a solution to this is adjusting the way circular barplots are drawn for trees with, say, < 100 tips; I think this would mostly involve altering [`Empress._addCircularBarCoords()`](https://github.com/biocore/empress/blob/e543610c5654399aa1dcbbede09b45b45c4170d0/empress/support_files/js/empress.js#L1026).

(...Noticed this problem while testing #505 :scissors: :evergreen_tree: :)

Contributor guide

Open the contributing guide

Research direction

Start in empress/support_files/js/empress.js at Empress._addCircularBarCoords(), where circular barplot coordinates are generated with four triangles per tip. Reproduce the issue with a tree containing fewer than 100 tips and inspect how the barplot curves relate to the tree layout. Done means the bars appear smoother for small trees and no longer overlap the tree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.