Shift clade root nodes during collapsing to center above their descendant tips
- Dominant language
- JavaScript
- Stars
- 56
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
This isn't a new idea - we talked about this on Slack sometime last month, I wanted to move it here so I didn't forget about it :P
This'd involve, on drawing a collapsed clade for the rectangular or circular layout, redrawing the tree with the clade root's position shifted (either on the y-axis for the rectangular layout or just having its angle changed for the circular layout) to be centered above its tips (rather than just above its children, as is the default for these layouts). This would get us the best of both worlds: the collapsed clade's width and height would both be interpretable in the context of the original tree, and the collapsed triangle / wedge would look symmetric since the root would be at its center y-position or angle value.
It should always be possible to do this for the rect / circular layout since part of the "guarantee" of those layout algorithms is that every tip is allocated its own space (either on the y-axis for the rect layout, or some angle section of the circle for the circular layout). So if a group of tips is collapsed, then the clade root can be positioned anywhere on the y-axis above its tips / with any angle between its tips' lowest and highest angle without crossing over other unrelated parts of the tree.
This might take an undue amount of effort to implement, and the current collapsing algorithms are already more than fine IMO. So this is probably not very high priority. However, it's something to think about for the future -- this would allow us to merge the code for these algorithms into a single option, which would probably make life easier for us (and would reduce the number of options users need to think about).
Contributor guide
Research direction
Start by locating the rectangular and circular layout collapsing algorithms and comparing how they position clade roots relative to descendant tips. Determine how to shift the root on the rectangular y-axis or circular angle, then verify that collapsed triangles and wedges are centered without crossing unrelated tree parts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100