biocore/empress

Support adjusting end angle of circular layout

Open

#509 opened on Apr 7, 2021

 (2 comments) (3 reactions) (0 assignees)JavaScript (32 forks)auto 404
feature requestgood first issuenice to have

Repository metrics

Stars
 (56 stars)
PR merge metrics
 (PR metrics pending)

Description

I thought we already had an issue for this, but apparently not!

Motivation: Lots of tree figures (e.g. Figure 1a in this paper I was reading) have a "gap" between between the start and end angle in the circular layout, which can look nice. In EMPress, we don't have this sort of gap by default, so the tree takes up an entire 360 degrees (or 2pi radians) of space:

lol

Changing this when re-doing the circular layout is actually pretty simple -- we should only need to adjust one line:

https://github.com/biocore/empress/blob/e543610c5654399aa1dcbbede09b45b45c4170d0/empress/support_files/js/layouts-util.js#L561

Changing the numerator in this line from 2*pi to 1.9*pi gives us this:

image

...And just 1*pi, for reference:

image

This even works well with barplots out of the box:

image

It should be possible to add a UI element (ideally the sort of thing that is only visible when the circular layout is active) that adjusts this value -- I guess it would be most user-friendly to take inputs in degrees and then transform them to radians internally.

A solution to this issue would pair really well with #359, although the issues aren't necessarily dependent on each other or anything.

Contributor guide